var CodeMirror = function() {
  function t(o, u) {
    function v(t) {
      return t >= 0 && t < Zn.size
    }

    function k(t) {
      return h(Zn, t)
    }

    function L(t, e) {
      sr = !0;
      for (var n = e - t.height, r = t; r; r = r.parent) r.height += n
    }

    function A(t) {
      var e = {
        line: 0,
        ch: 0
      };
      le(e, {
        line: Zn.size - 1,
        ch: k(Zn.size - 1).text.length
      }, X(t), e, e), nr = !0
    }

    function P() {
      var t = [];
      return Zn.iter(0, Zn.size, function(e) {
        t.push(e.text)
      }), t.join("\n")
    }

    function U(t) {
      function e(t) {
        var n = gn(t, !0);
        if (n && !E(n, l)) {
          qn || ie(), l = n, We(r, n), nr = !1;
          var i = be();
          (n.line >= i.to || n.line < i.from) && (o = setTimeout(An(function() {
            e(t)
          }), 150))
        }
      }
      Ee(t.shiftKey);
      for (var n = w(t); n != Nn; n = n.parentNode)
        if (n.parentNode == On && n != Rn) return;
      for (var n = w(t); n != Nn; n = n.parentNode)
        if (n.parentNode == Un) return zn.onGutterClick && zn.onGutterClick(wr, I(Un.childNodes, n) + pr, t), y(t);
      var r = gn(t);
      switch (M(t)) {
        case 3:
          return void(j && !R && vn(t));
        case 2:
          return void(r && He(r.line, r.ch, !0))
      }
      if (!r) return void(w(t) == In && y(t));
      qn || ie();
      var i = +new Date;
      if (tr && tr.time > i - 400 && E(tr.pos, r)) return y(t), setTimeout(ke, 20), Ke(r.line);
      if (Qn && Qn.time > i - 400 && E(Qn.pos, r)) return tr = {
        time: i,
        pos: r
      }, y(t), Ve(r);
      Qn = {
        time: i,
        pos: r
      };
      var o, l = r;
      if (F && !E(hr.from, hr.to) && !W(r, hr.from) && !W(hr.to, r)) {
        Y && (Bn.draggable = !0);
        var a = b(Wn, "mouseup", An(function(e) {
          Y && (Bn.draggable = !1), er = !1, a(), Math.abs(t.clientX - e.clientX) + Math.abs(t.clientY - e.clientY) < 10 && (y(e), He(r.line, r.ch, !0), ke())
        }), !0);
        return void(er = !0)
      }
      y(t), He(r.line, r.ch, !0);
      var s = b(Wn, "mousemove", An(function(t) {
          clearTimeout(o), y(t), e(t)
        }), !0),
        a = b(Wn, "mouseup", An(function(t) {
          clearTimeout(o);
          var e = gn(t);
          e && We(r, e), y(t), ke(), nr = !0, s(), a()
        }), !0)
    }

    function _(t) {
      for (var e = w(t); e != Nn; e = e.parentNode)
        if (e.parentNode == Un) return y(t);
      var n = gn(t);
      n && (tr = {
        time: +new Date,
        pos: n
      }, y(t), Ve(n))
    }

    function J(t) {
      function e(t, e) {
        var r = new FileReader;
        r.onload = function() {
          o[e] = r.result, ++l == i && (n = Oe(n), An(function() {
            var t = ce(o.join(""), n, n);
            We(n, t)
          })())
        }, r.readAsText(t)
      }
      t.preventDefault();
      var n = gn(t, !0),
        r = t.dataTransfer.files;
      if (n && !zn.readOnly)
        if (r && r.length && window.FileReader && window.File)
          for (var i = r.length, o = Array(i), l = 0, a = 0; i > a; ++a) e(r[a], a);
        else try {
          var o = t.dataTransfer.getData("Text");
          if (o) {
            var s = ce(o, n, n),
              u = hr.from,
              f = hr.to;
            We(n, s), er && ce("", u, f), ke()
          }
        } catch (t) {}
    }

    function Q(t) {
      var e = pe();
      D(e), t.dataTransfer.setDragImage(q, 0, 0), t.dataTransfer.setData("Text", e)
    }

    function te(t) {
      var r, i, o = Z[t.keyCode],
        l = K[zn.keyMap].auto;
      if (null == o || t.altGraphKey) return l && (zn.keyMap = l), null;
      if (t.altKey && (o = "Alt-" + o), t.ctrlKey && (o = "Ctrl-" + o), t.metaKey && (o = "Cmd-" + o), t.shiftKey && (r = e("Shift-" + o, zn.extraKeys, zn.keyMap)) ? i = !0 : r = e(o, zn.extraKeys, zn.keyMap), "string" == typeof r && (r = V.propertyIsEnumerable(r) ? V[r] : null), !l || !r && n(t) || (zn.keyMap = l), !r) return !1;
      if (i) {
        var a = Jn;
        Jn = null, r(wr), Jn = a
      } else r(wr);
      return y(t), !0
    }

    function ee(t) {
      qn || ie();
      var e = t.keyCode;
      if (G && 27 == e && (t.returnValue = !1), Ee(16 == e || t.shiftKey), !zn.onKeyEvent || !zn.onKeyEvent(wr, x(t))) {
        var n = te(t);
        window.opera && (Mr = n ? t.keyCode : null, !n && (R ? t.metaKey : t.ctrlKey) && 88 == t.keyCode && he(""))
      }
    }

    function ne(t) {
      if (window.opera && t.keyCode == Mr) return Mr = null, void y(t);
      if (!(zn.onKeyEvent && zn.onKeyEvent(wr, x(t)) || window.opera && !t.which && te(t))) {
        if (zn.electricChars && Yn.electricChars) {
          var e = String.fromCharCode(null == t.charCode ? t.keyCode : t.charCode);
          Yn.electricChars.indexOf(e) > -1 && setTimeout(An(function() {
            je(hr.to.line, "smart")
          }), 75)
        }
        ve()
      }
    }

    function re(t) {
      zn.onKeyEvent && zn.onKeyEvent(wr, x(t)) || 16 == t.keyCode && (Jn = null)
    }

    function ie() {
      zn.readOnly || (qn || (zn.onFocus && zn.onFocus(wr), qn = !0, -1 == Nn.className.search(/\bCodeMirror-focused\b/) && (Nn.className += " CodeMirror-focused"), ar || ye(!0)), ge(), xn())
    }

    function oe() {
      qn && (zn.onBlur && zn.onBlur(wr), qn = !1, Nn.className = Nn.className.replace(" CodeMirror-focused", "")), clearInterval(Gn), setTimeout(function() {
        qn || (Jn = null)
      }, 150)
    }

    function le(t, e, n, r, i) {
      if (kr) {
        var o = [];
        for (Zn.iter(t.line, e.line + 1, function(t) {
            o.push(t.text)
          }), kr.addChange(t.line, n.length, o); kr.done.length > zn.undoDepth;) kr.done.shift()
      }
      fe(t, e, n, r, i)
    }

    function ae(t, e) {
      var n = t.pop();
      if (n) {
        var r = [],
          i = n.start + n.added;
        Zn.iter(n.start, i, function(t) {
          r.push(t.text)
        }), e.push({
          start: n.start,
          added: n.old.length,
          old: r
        });
        var o = Oe({
          line: n.start + n.old.length - 1,
          ch: H(r[r.length - 1], n.old[n.old.length - 1])
        });
        fe({
          line: n.start,
          ch: 0
        }, {
          line: i - 1,
          ch: k(i - 1).text.length
        }, n.old, o, o), nr = !0
      }
    }

    function se() {
      ae(kr.done, kr.undone)
    }

    function ue() {
      ae(kr.undone, kr.done)
    }

    function fe(t, e, n, r, i) {
      function o(t) {
        return t <= Math.min(e.line, e.line + x) ? t : t + x
      }
      var l = !1,
        a = xr.length;
      zn.lineWrapping || Zn.iter(t.line, e.line, function(t) {
        return t.text.length == a ? (l = !0, !0) : void 0
      }), (t.line != e.line || n.length > 1) && (sr = !0);
      var u = e.line - t.line,
        f = k(t.line),
        c = k(e.line);
      if (0 == t.ch && 0 == e.ch && "" == n[n.length - 1]) {
        var h = [],
          d = null;
        t.line ? (d = k(t.line - 1), d.fixMarkEnds(c)) : c.fixMarkStarts();
        for (var m = 0, p = n.length - 1; p > m; ++m) h.push(s.inheritMarks(n[m], d));
        u && Zn.remove(t.line, u, ur), h.length && Zn.insert(t.line, h)
      } else if (f == c)
        if (1 == n.length) f.replace(t.ch, e.ch, n[0]);
        else {
          c = f.split(e.ch, n[n.length - 1]), f.replace(t.ch, null, n[0]), f.fixMarkEnds(c);
          for (var h = [], m = 1, p = n.length - 1; p > m; ++m) h.push(s.inheritMarks(n[m], f));
          h.push(c), Zn.insert(t.line + 1, h)
        }
      else if (1 == n.length) f.replace(t.ch, null, n[0]), c.replace(null, e.ch, ""), f.append(c), Zn.remove(t.line + 1, u, ur);
      else {
        var h = [];
        f.replace(t.ch, null, n[0]), c.replace(null, e.ch, n[n.length - 1]), f.fixMarkEnds(c);
        for (var m = 1, p = n.length - 1; p > m; ++m) h.push(s.inheritMarks(n[m], f));
        u > 1 && Zn.remove(t.line + 1, u - 1, ur), Zn.insert(t.line + 1, h)
      }
      if (zn.lineWrapping) {
        var g = In.clientWidth / dn() - 3;
        Zn.iter(t.line, t.line + n.length, function(t) {
          if (!t.hidden) {
            var e = Math.ceil(t.text.length / g) || 1;
            e != t.height && L(t, e)
          }
        })
      } else Zn.iter(t.line, m + n.length, function(t) {
        var e = t.text;
        e.length > a && (xr = e, a = e.length, cr = null, l = !1)
      }), l && (a = 0, xr = "", cr = null, Zn.iter(0, Zn.size, function(t) {
        var e = t.text;
        e.length > a && (a = e.length, xr = e)
      }));
      for (var v = [], x = n.length - u - 1, m = 0, y = _n.length; y > m; ++m) {
        var C = _n[m];
        C < t.line ? v.push(C) : C > e.line && v.push(C + x)
      }
      var w = t.line + Math.min(n.length, 500);
      wn(t.line, w), v.push(w), _n = v, bn(100), ir.push({
        from: t.line,
        to: e.line + 1,
        diff: x
      });
      var M = {
        from: t,
        to: e,
        text: n
      };
      if (or) {
        for (var b = or; b.next; b = b.next);
        b.next = M
      } else or = M;
      Ne(r, i, o(hr.from.line), o(hr.to.line)), On.style.height = Zn.height * hn() + 2 * mn() + "px"
    }

    function ce(t, e, n) {
      function r(r) {
        if (W(r, e)) return r;
        if (!W(n, r)) return i;
        var o = r.line + t.length - (n.line - e.line) - 1,
          l = r.ch;
        return r.line == n.line && (l += t[t.length - 1].length - (n.ch - (n.line == e.line ? e.ch : 0))), {
          line: o,
          ch: l
        }
      }
      e = Oe(e), n = n ? Oe(n) : e, t = X(t);
      var i;
      return de(t, e, n, function(t) {
        return i = t, {
          from: r(hr.from),
          to: r(hr.to)
        }
      }), i
    }

    function he(t, e) {
      de(X(t), hr.from, hr.to, function(t) {
        return "end" == e ? {
          from: t,
          to: t
        } : "start" == e ? {
          from: hr.from,
          to: hr.from
        } : {
          from: hr.from,
          to: t
        }
      })
    }

    function de(t, e, n, r) {
      var i = 1 == t.length ? t[0].length + e.ch : t[t.length - 1].length,
        o = r({
          line: e.line + t.length - 1,
          ch: i
        });
      le(e, n, t, o.from, o.to)
    }

    function me(t, e) {
      var n = t.line,
        r = e.line;
      if (n == r) return k(n).text.slice(t.ch, e.ch);
      var i = [k(n).text.slice(t.ch)];
      return Zn.iter(n + 1, r, function(t) {
        i.push(t.text)
      }), i.push(k(r).text.slice(0, e.ch)), i.join("\n")
    }

    function pe() {
      return me(hr.from, hr.to)
    }

    function ge() {
      br || Xn.set(zn.pollInterval, function() {
        Sn(), xe(), qn && ge(), Ln()
      })
    }

    function ve() {
      function t() {
        Sn();
        var n = xe();
        n || e ? (br = !1, ge()) : (e = !0, Xn.set(60, t)), Ln()
      }
      var e = !1;
      br = !0, Xn.set(20, t)
    }

    function xe() {
      if (ar || !qn || $(Hn)) return !1;
      var t = Hn.value;
      if (t == Sr) return !1;
      Jn = null;
      for (var e = 0, n = Math.min(Sr.length, t.length); n > e && Sr[e] == t[e];) ++e;
      return e < Sr.length ? hr.from = {
        line: hr.from.line,
        ch: hr.from.ch - (Sr.length - e)
      } : dr && E(hr.from, hr.to) && (hr.to = {
        line: hr.to.line,
        ch: Math.min(k(hr.to.line).text.length, hr.to.ch + (t.length - e))
      }), he(t.slice(e), "end"), Sr = t, !0
    }

    function ye(t) {
      E(hr.from, hr.to) ? t && (Sr = Hn.value = "") : (Sr = "", Hn.value = pe(), Hn.select())
    }

    function ke() {
      zn.readOnly || Hn.focus()
    }

    function Ce() {
      if (Kn.getBoundingClientRect) {
        var t = Kn.getBoundingClientRect();
        if (!G || t.top != t.bottom) {
          var e = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
          (t.top < 0 || t.bottom > e) && Kn.scrollIntoView()
        }
      }
    }

    function we() {
      var t = un(hr.inverted ? hr.from : hr.to),
        e = zn.lineWrapping ? Math.min(t.x, Bn.offsetWidth) : t.x;
      return Me(e, t.y, e, t.yBot)
    }

    function Me(t, e, n, r) {
      var i = pn(),
        o = mn(),
        l = hn();
      e += o, r += o, t += i, n += i;
      var a = In.clientHeight,
        s = In.scrollTop,
        u = !1,
        f = !0;
      s > e ? (In.scrollTop = Math.max(0, e - 2 * l), u = !0) : r > s + a && (In.scrollTop = r + l - a, u = !0);
      var c = In.clientWidth,
        h = In.scrollLeft,
        d = zn.fixedGutter ? Pn.clientWidth : 0;
      return h + d > t ? (50 > t && (t = 0), In.scrollLeft = Math.max(0, t - 10 - d), u = !0) : n > c + h - 3 && (In.scrollLeft = n + 10 - c, u = !0, n > On.clientWidth && (f = !1)), u && zn.onScroll && zn.onScroll(wr), f
    }

    function be() {
      var t = hn(),
        e = In.scrollTop - mn(),
        n = Math.max(0, Math.floor(e / t)),
        r = Math.ceil((e + In.clientHeight) / t);
      return {
        from: m(Zn, n),
        to: m(Zn, r)
      }
    }

    function Se(t, e) {
      if (!In.clientWidth) return void(pr = gr = mr = 0);
      var n = be();
      if (!(t !== !0 && 0 == t.length && n.from >= pr && n.to <= gr)) {
        var r = Math.max(n.from - 100, 0),
          i = Math.min(Zn.size, n.to + 100);
        r > pr && 20 > r - pr && (r = pr), gr > i && 20 > gr - i && (i = Math.min(Zn.size, gr));
        for (var o = t === !0 ? [] : Le([{
            from: pr,
            to: gr,
            domStart: 0
          }], t), l = 0, a = 0; a < o.length; ++a) {
          var s = o[a];
          s.from < r && (s.domStart += r - s.from, s.from = r), s.to > i && (s.to = i), s.from >= s.to ? o.splice(a--, 1) : l += s.to - s.from
        }
        if (l != i - r) {
          o.sort(function(t, e) {
            return t.domStart - e.domStart
          });
          var u = hn(),
            f = Pn.style.display;
          Fn.style.display = Pn.style.display = "none", Ae(r, i, o), Fn.style.display = "";
          var c = r != pr || i != gr || vr != In.clientHeight + u;
          if (c && (vr = In.clientHeight + u), pr = r, gr = i, mr = p(Zn, r), Rn.style.top = mr * u + "px", On.style.height = Zn.height * u + 2 * mn() + "px", Fn.childNodes.length != gr - pr) throw new Error("BAD PATCH! " + JSON.stringify(o) + " size=" + (gr - pr) + " nodes=" + Fn.childNodes.length);
          if (zn.lineWrapping) {
            cr = In.clientWidth;
            var h = Fn.firstChild;
            Zn.iter(pr, gr, function(t) {
              if (!t.hidden) {
                var e = Math.round(h.offsetHeight / u) || 1;
                t.height != e && (L(t, e), sr = !0)
              }
              h = h.nextSibling
            })
          } else null == cr && (cr = an(xr)), cr > In.clientWidth ? (Bn.style.width = cr + "px", On.style.width = "", On.style.width = In.scrollWidth + "px") : Bn.style.width = On.style.width = "";
          return Pn.style.display = f, (c || sr) && ze(), Te(), !e && zn.onUpdate && zn.onUpdate(wr), !0
        }
      }
    }

    function Le(t, e) {
      for (var n = 0, r = e.length || 0; r > n; ++n) {
        for (var i = e[n], o = [], l = i.diff || 0, a = 0, s = t.length; s > a; ++a) {
          var u = t[a];
          i.to <= u.from && i.diff ? o.push({
            from: u.from + l,
            to: u.to + l,
            domStart: u.domStart
          }) : i.to <= u.from || i.from >= u.to ? o.push(u) : (i.from > u.from && o.push({
            from: u.from,
            to: i.from,
            domStart: u.domStart
          }), i.to < u.to && o.push({
            from: i.to + l,
            to: u.to + l,
            domStart: u.domStart + (i.to - u.from)
          }))
        }
        t = o
      }
      return t
    }

    function Ae(t, e, n) {
      function r(t) {
        var e = t.nextSibling;
        return t.parentNode.removeChild(t), e
      }
      if (n.length) {
        for (var i = 0, o = Fn.firstChild, l = 0; l < n.length; ++l) {
          for (var a = n[l]; a.domStart > i;) o = r(o), i++;
          for (var s = 0, u = a.to - a.from; u > s; ++s) o = o.nextSibling, i++
        }
        for (; o;) o = r(o)
      } else Fn.innerHTML = "";
      var f = n.shift(),
        o = Fn.firstChild,
        s = t,
        c = hr.from.line,
        h = hr.to.line,
        d = t > c && h >= t,
        m = Wn.createElement("div");
      Zn.iter(t, e, function(t) {
        var e = null,
          r = null;
        d ? (e = 0, h == s && (d = !1, r = hr.to.ch)) : c == s && (h == s ? (e = hr.from.ch, r = hr.to.ch) : (d = !0, e = hr.from.ch)), f && f.to == s && (f = n.shift()), !f || f.from > s ? (m.innerHTML = t.hidden ? "<pre></pre>" : t.getHTML(e, r, !0, yr), Fn.insertBefore(m.firstChild, o)) : o = o.nextSibling, ++s
      })
    }

    function ze() {
      if (zn.gutter || zn.lineNumbers) {
        var t = Rn.offsetHeight,
          e = In.clientHeight;
        Pn.style.height = (2 > t - e ? e : t) + "px";
        var n = [],
          r = pr;
        Zn.iter(pr, Math.max(gr, pr + 1), function(t) {
          if (t.hidden) n.push("<pre></pre>");
          else {
            var e = t.gutterMarker,
              i = zn.lineNumbers ? r + zn.firstLineNumber : null;
            e && e.text ? i = e.text.replace("%N%", null != i ? i : "") : null == i && (i = " "), n.push(e && e.style ? '<pre class="' + e.style + '">' : "<pre>", i);
            for (var o = 1; o < t.height; ++o) n.push("<br/>&#160;");
            n.push("</pre>")
          }++r
        }), Pn.style.display = "none", Un.innerHTML = n.join("");
        for (var i = String(Zn.size).length, o = Un.firstChild, l = T(o), a = ""; l.length + a.length < i;) a += " ";
        a && o.insertBefore(Wn.createTextNode(a), o.firstChild), Pn.style.display = "", Bn.style.marginLeft = Pn.offsetWidth + "px", sr = !1
      }
    }

    function Te() {
      var t = hr.inverted ? hr.from : hr.to,
        e = (hn(), un(t, !0)),
        n = z(Nn),
        r = z(Fn);
      Dn.style.top = e.y + r.top - n.top + "px", Dn.style.left = e.x + r.left - n.left + "px", E(hr.from, hr.to) ? (Kn.style.top = e.y + "px", Kn.style.left = (zn.lineWrapping ? Math.min(e.x, Bn.offsetWidth) : e.x) + "px", Kn.style.display = "") : Kn.style.display = "none"
    }

    function Ee(t) {
      Jn = t ? Jn || (hr.inverted ? hr.to : hr.from) : null
    }

    function We(t, e) {
      var n = Jn && Oe(Jn);
      n && (W(n, t) ? t = n : W(e, n) && (e = n)), Ne(t, e), rr = !0
    }

    function Ne(t, e, n, r) {
      if (Lr = null, null == n && (n = hr.from.line, r = hr.to.line), !E(hr.from, t) || !E(hr.to, e)) {
        if (W(e, t)) {
          var i = e;
          e = t, t = i
        }
        t.line != n && (t = De(t, n, hr.from.ch)), e.line != r && (e = De(e, r, hr.to.ch)), E(t, e) ? hr.inverted = !1 : E(t, hr.to) ? hr.inverted = !1 : E(e, hr.from) && (hr.inverted = !0), E(t, e) ? E(hr.from, hr.to) || ir.push({
          from: n,
          to: r + 1
        }) : E(hr.from, hr.to) ? ir.push({
          from: t.line,
          to: e.line + 1
        }) : (E(t, hr.from) || ir.push(t.line < n ? {
          from: t.line,
          to: Math.min(e.line, n) + 1
        } : {
          from: n,
          to: Math.min(r, t.line) + 1
        }), E(e, hr.to) || ir.push(e.line < r ? {
          from: Math.max(n, t.line),
          to: r + 1
        } : {
          from: Math.max(t.line, r),
          to: e.line + 1
        })), hr.from = t, hr.to = e, lr = !0
      }
    }

    function De(t, e, n) {
      function r(e) {
        for (var r = t.line + e, i = 1 == e ? Zn.size : -1; r != i;) {
          var o = k(r);
          if (!o.hidden) {
            var l = t.ch;
            return (l > n || l > o.text.length) && (l = o.text.length), {
              line: r,
              ch: l
            }
          }
          r += e
        }
      }
      var i = k(t.line);
      return i.hidden ? t.line >= e ? r(1) || r(-1) : r(-1) || r(1) : t
    }

    function He(t, e, n) {
      var r = Oe({
        line: t,
        ch: e || 0
      });
      (n ? We : Ne)(r, r)
    }

    function Ie(t) {
      return Math.max(0, Math.min(t, Zn.size - 1))
    }

    function Oe(t) {
      if (t.line < 0) return {
        line: 0,
        ch: 0
      };
      if (t.line >= Zn.size) return {
        line: Zn.size - 1,
        ch: k(Zn.size - 1).text.length
      };
      var e = t.ch,
        n = k(t.line).text.length;
      return null == e || e > n ? {
        line: t.line,
        ch: n
      } : 0 > e ? {
        line: t.line,
        ch: 0
      } : t
    }

    function Re(t, e) {
      function n() {
        for (var e = o + t, n = 0 > t ? -1 : Zn.size; e != n; e += t) {
          var r = k(e);
          if (!r.hidden) return o = e, a = r, !0
        }
      }

      function r(e) {
        if (l == (0 > t ? 0 : a.text.length)) {
          if (e || !n()) return !1;
          l = 0 > t ? a.text.length : 0
        } else l += t;
        return !0
      }
      var i = hr.inverted ? hr.from : hr.to,
        o = i.line,
        l = i.ch,
        a = k(o);
      if ("char" == e) r();
      else if ("column" == e) r(!0);
      else if ("word" == e)
        for (var s = !1; !(0 > t) || r();) {
          if (O(a.text.charAt(l))) s = !0;
          else if (s) {
            0 > t && (t = 1, r());
            break
          }
          if (t > 0 && !r()) break
        }
      return {
        line: o,
        ch: l
      }
    }

    function Pe(t, e) {
      var n = 0 > t ? hr.from : hr.to;
      (Jn || E(hr.from, hr.to)) && (n = Re(t, e)), He(n.line, n.ch, !0)
    }

    function Ue(t, e) {
      E(hr.from, hr.to) ? 0 > t ? ce("", Re(t, e), hr.to) : ce("", hr.from, Re(t, e)) : ce("", hr.from, hr.to), rr = !0
    }

    function Be(t, e) {
      var n = 0,
        r = un(hr.inverted ? hr.from : hr.to, !0);
      null != Lr && (r.x = Lr), "page" == e ? n = In.clientHeight : "line" == e && (n = hn());
      var i = fn(r.x, r.y + n * t + 2);
      He(i.line, i.ch, !0), Lr = r.x
    }

    function Ve(t) {
      for (var e = k(t.line).text, n = t.ch, r = t.ch; n > 0 && O(e.charAt(n - 1));) --n;
      for (; r < e.length && O(e.charAt(r));) ++r;
      We({
        line: t.line,
        ch: n
      }, {
        line: t.line,
        ch: r
      })
    }

    function Ke(t) {
      We({
        line: t,
        ch: 0
      }, {
        line: t,
        ch: k(t).text.length
      })
    }

    function Fe(t) {
      if (E(hr.from, hr.to)) return je(hr.from.line, t);
      for (var e = hr.to.line - (hr.to.ch ? 0 : 1), n = hr.from.line; e >= n; ++n) je(n, t)
    }

    function je(t, e) {
      if (e || (e = "add"), "smart" == e)
        if (Yn.indent) var n = Cn(t);
        else e = "prev";
      var r, i = k(t),
        o = i.indentation(zn.tabSize),
        l = i.text.match(/^\s*/)[0];
      "prev" == e ? r = t ? k(t - 1).indentation(zn.tabSize) : 0 : "smart" == e ? r = Yn.indent(n, i.text.slice(l.length), i.text) : "add" == e ? r = o + zn.indentUnit : "subtract" == e && (r = o - zn.indentUnit), r = Math.max(0, r);
      var a = r - o;
      if (a) {
        var s = "",
          u = 0;
        if (zn.indentWithTabs)
          for (var f = Math.floor(r / zn.tabSize); f; --f) u += zn.tabSize, s += "	";
        for (; r > u;) ++u, s += " "
      } else {
        if (hr.from.line != t && hr.to.line != t) return;
        var s = l
      }
      ce(s, {
        line: t,
        ch: 0
      }, {
        line: t,
        ch: l.length
      })
    }

    function Ge() {
      Yn = t.getMode(zn, zn.mode), Zn.iter(0, Zn.size, function(t) {
        t.stateAfter = null
      }), _n = [0], bn()
    }

    function Ye() {
      var t = zn.gutter || zn.lineNumbers;
      Pn.style.display = t ? "" : "none", t ? sr = !0 : Fn.parentNode.style.marginLeft = 0
    }

    function _e() {
      if (zn.lineWrapping) {
        Nn.className += " CodeMirror-wrap";
        var t = In.clientWidth / dn() - 3;
        Zn.iter(0, Zn.size, function(e) {
          if (!e.hidden) {
            var n = Math.ceil(e.text.length / t) || 1;
            1 != n && L(e, n)
          }
        }), Bn.style.width = On.style.width = ""
      } else Nn.className = Nn.className.replace(" CodeMirror-wrap", ""), cr = null, xr = "", Zn.iter(0, Zn.size, function(t) {
        1 == t.height || t.hidden || L(t, 1), t.text.length > xr.length && (xr = t.text)
      });
      ir.push({
        from: 0,
        to: Zn.size
      })
    }

    function qe() {
      for (var t = '<span class="cm-tab">', e = 0; e < zn.tabSize; ++e) t += " ";
      return t + "</span>"
    }

    function Xe() {
      yr = qe(), Se(!0)
    }

    function $e() {
      In.className = In.className.replace(/\s*cm-s-\w+/g, "") + zn.theme.replace(/(^|\s)\s*/g, " cm-s-")
    }

    function Ze() {
      this.set = []
    }

    function Je(t, e, n) {
      function r(t, e, n, r) {
        k(t).addMark(new l(e, n, r, i.set))
      }
      t = Oe(t), e = Oe(e);
      var i = new Ze;
      if (t.line == e.line) r(t.line, t.ch, e.ch, n);
      else {
        r(t.line, t.ch, null, n);
        for (var o = t.line + 1, a = e.line; a > o; ++o) r(o, null, null, n);
        r(e.line, null, e.ch, n)
      }
      return ir.push({
        from: t.line,
        to: e.line + 1
      }), i
    }

    function Qe(t) {
      t = Oe(t);
      var e = new a(t.ch);
      return k(t.line).addMark(e), e
    }

    function tn(t, e, n) {
      return "number" == typeof t && (t = k(Ie(t))), t.gutterMarker = {
        text: e,
        style: n
      }, sr = !0, t
    }

    function en(t) {
      "number" == typeof t && (t = k(Ie(t))), t.gutterMarker = null, sr = !0
    }

    function nn(t, e) {
      var n = t,
        r = t;
      return "number" == typeof t ? r = k(Ie(t)) : n = d(t), null == n ? null : e(r, n) ? (ir.push({
        from: n,
        to: n + 1
      }), r) : null
    }

    function rn(t, e) {
      return nn(t, function(t) {
        return t.className != e ? (t.className = e, !0) : void 0
      })
    }

    function on(t, e) {
      return nn(t, function(t, n) {
        return t.hidden != e ? (t.hidden = e, L(t, e ? 0 : 1), !e || hr.from.line != n && hr.to.line != n || Ne(De(hr.from, hr.from.line, hr.from.ch), De(hr.to, hr.to.line, hr.to.ch)), sr = !0) : void 0
      })
    }

    function ln(t) {
      if ("number" == typeof t) {
        if (!v(t)) return null;
        var e = t;
        if (t = k(t), !t) return null
      } else {
        var e = d(t);
        if (null == e) return null
      }
      var n = t.gutterMarker;
      return {
        line: e,
        handle: t,
        text: t.text,
        markerText: n && n.text,
        markerClass: n && n.style,
        lineClass: t.className
      }
    }

    function an(t) {
      return Vn.innerHTML = "<pre><span>x</span></pre>", Vn.firstChild.firstChild.firstChild.nodeValue = t, Vn.firstChild.firstChild.offsetWidth || 10
    }

    function sn(t, e) {
      var n = "";
      if (zn.lineWrapping) {
        var r = t.text.indexOf(" ", e + 2);
        n = D(t.text.slice(e + 1, 0 > r ? t.text.length : r + (G ? 5 : 0)))
      }
      Vn.innerHTML = "<pre>" + t.getHTML(null, null, !1, yr, e) + '<span id="CodeMirror-temp-' + Wr + '">' + D(t.text.charAt(e) || " ") + "</span>" + n + "</pre>";
      var i = document.getElementById("CodeMirror-temp-" + Wr),
        o = i.offsetTop,
        l = i.offsetLeft;
      if (G && e && 0 == o && 0 == l) {
        var a = document.createElement("span");
        a.innerHTML = "x", i.parentNode.insertBefore(a, i.nextSibling), o = a.offsetTop
      }
      return {
        top: o,
        left: l
      }
    }

    function un(t, e) {
      var n, r = hn(),
        i = r * (p(Zn, t.line) - (e ? mr : 0));
      if (0 == t.ch) n = 0;
      else {
        var o = sn(k(t.line), t.ch);
        n = o.left, zn.lineWrapping && (i += Math.max(0, o.top))
      }
      return {
        x: n,
        y: i,
        yBot: i + r
      }
    }

    function fn(t, e) {
      function n(t) {
        var e = sn(a, t);
        if (u) {
          var n = Math.round(e.top / r);
          return Math.max(0, e.left + (n - f) * In.clientWidth)
        }
        return e.left
      }
      0 > e && (e = 0);
      var r = hn(),
        i = dn(),
        o = mr + Math.floor(e / r),
        l = m(Zn, o);
      if (l >= Zn.size) return {
        line: Zn.size - 1,
        ch: k(Zn.size - 1).text.length
      };
      var a = k(l),
        s = a.text,
        u = zn.lineWrapping,
        f = u ? o - p(Zn, l) : 0;
      if (0 >= t && 0 == f) return {
        line: l,
        ch: 0
      };
      for (var c, h = 0, d = 0, g = s.length, v = Math.min(g, Math.ceil((t + f * In.clientWidth * .9) / i));;) {
        var x = n(v);
        if (!(t >= x && g > v)) {
          c = x, g = v;
          break
        }
        v = Math.min(g, Math.ceil(1.2 * v))
      }
      if (t > c) return {
        line: l,
        ch: g
      };
      for (v = Math.floor(.8 * g), x = n(v), t > x && (h = v, d = x);;) {
        if (1 >= g - h) return {
          line: l,
          ch: c - t > t - d ? h : g
        };
        var y = Math.ceil((h + g) / 2),
          C = n(y);
        C > t ? (g = y, c = C) : (h = y, d = C)
      }
    }

    function cn(t) {
      var e = un(t, !0),
        n = z(Bn);
      return {
        x: n.left + e.x,
        y: n.top + e.y,
        yBot: n.top + e.yBot
      }
    }

    function hn() {
      if (null == Tr) {
        Tr = "<pre>";
        for (var t = 0; 49 > t; ++t) Tr += "x<br/>";
        Tr += "x</pre>"
      }
      var e = Fn.clientHeight;
      return e == zr ? Ar : (zr = e, Vn.innerHTML = Tr, Ar = Vn.firstChild.offsetHeight / 50 || 1, Vn.innerHTML = "", Ar)
    }

    function dn() {
      return In.clientWidth == Nr ? Er : (Nr = In.clientWidth, Er = an("x"))
    }

    function mn() {
      return Bn.offsetTop
    }

    function pn() {
      return Bn.offsetLeft
    }

    function gn(t, e) {
      var n, r, i = z(In, !0);
      try {
        n = t.clientX, r = t.clientY
      } catch (t) {
        return null
      }
      if (!e && (n - i.left > In.clientWidth || r - i.top > In.clientHeight)) return null;
      var o = z(Bn, !0);
      return fn(n - o.left, r - o.top)
    }

    function vn(t) {
      function e() {
        var t = X(Hn.value).join("\n");
        t != i && An(he)(t, "end"), Dn.style.position = "relative", Hn.style.cssText = r, ar = !1, ye(!0), ge()
      }
      var n = gn(t);
      if (n && !window.opera) {
        (E(hr.from, hr.to) || W(n, hr.from) || !W(n, hr.to)) && An(He)(n.line, n.ch);
        var r = Hn.style.cssText;
        Dn.style.position = "absolute", Hn.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (t.clientY - 5) + "px; left: " + (t.clientX - 5) + "px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);", ar = !0;
        var i = Hn.value = pe();
        if (ke(), Hn.select(), j) {
          C(t);
          var o = b(window, "mouseup", function() {
            o(), setTimeout(e, 20)
          }, !0)
        } else setTimeout(e, 50)
      }
    }

    function xn() {
      clearInterval(Gn);
      var t = !0;
      Kn.style.visibility = "", Gn = setInterval(function() {
        Kn.style.visibility = (t = !t) ? "" : "hidden"
      }, 650)
    }

    function yn(t) {
      function e(t, e, n) {
        if (t.text)
          for (var r, i = t.styles, o = l ? 0 : t.text.length - 1, s = l ? 0 : i.length - 2, u = l ? i.length : -2; s != u; s += 2 * a) {
            var f = i[s];
            if (null == i[s + 1] || i[s + 1] == h) {
              for (var c = l ? 0 : f.length - 1, p = l ? f.length : -1; c != p; c += a, o += a)
                if (o >= e && n > o && m.test(r = f.charAt(c))) {
                  var g = Dr[r];
                  if (">" == g.charAt(1) == l) d.push(r);
                  else {
                    if (d.pop() != g.charAt(0)) return {
                      pos: o,
                      match: !1
                    };
                    if (!d.length) return {
                      pos: o,
                      match: !0
                    }
                  }
                }
            } else o += a * f.length
          }
      }
      var n = hr.inverted ? hr.from : hr.to,
        r = k(n.line),
        i = n.ch - 1,
        o = i >= 0 && Dr[r.text.charAt(i)] || Dr[r.text.charAt(++i)];
      if (o) {
        for (var l = (o.charAt(0), ">" == o.charAt(1)), a = l ? 1 : -1, s = r.styles, u = i + 1, f = 0, c = s.length; c > f; f += 2)
          if ((u -= s[f].length) <= 0) {
            var h = s[f + 1];
            break
          } for (var d = [r.text.charAt(i)], m = /[(){}[\]]/, f = n.line, c = l ? Math.min(f + 100, Zn.size) : Math.max(-1, f - 100); f != c; f += a) {
          var r = k(f),
            p = f == n.line,
            g = e(r, p && l ? i + 1 : 0, p && !l ? i : r.text.length);
          if (g) break
        }
        g || (g = {
          pos: null,
          match: !1
        });
        var h = g.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket",
          v = Je({
            line: n.line,
            ch: i
          }, {
            line: n.line,
            ch: i + 1
          }, h),
          x = null != g.pos && Je({
            line: f,
            ch: g.pos
          }, {
            line: f,
            ch: g.pos + 1
          }, h),
          y = An(function() {
            v.clear(), x && x.clear()
          });
        t ? setTimeout(y, 800) : fr = y
      }
    }

    function kn(t) {
      for (var e, n, r = t, i = t - 40; r > i; --r) {
        if (0 == r) return 0;
        var o = k(r - 1);
        if (o.stateAfter) return r;
        var l = o.indentation(zn.tabSize);
        (null == n || e > l) && (n = r - 1, e = l)
      }
      return n
    }

    function Cn(t) {
      var e = kn(t),
        n = e && k(e - 1).stateAfter;
      return n = n ? r(Yn, n) : i(Yn), Zn.iter(e, t, function(t) {
        t.highlight(Yn, n, zn.tabSize), t.stateAfter = r(Yn, n)
      }), t > e && ir.push({
        from: e,
        to: t
      }), t < Zn.size && !k(t).stateAfter && _n.push(t), n
    }

    function wn(t, e) {
      var n = Cn(t);
      Zn.iter(t, e, function(t) {
        t.highlight(Yn, n, zn.tabSize), t.stateAfter = r(Yn, n)
      })
    }

    function Mn() {
      for (var t = +new Date + zn.workTime, e = _n.length; _n.length;) {
        if (k(pr).stateAfter) var n = _n.pop();
        else var n = pr;
        if (!(n >= Zn.size)) {
          var o = kn(n),
            l = o && k(o - 1).stateAfter;
          l = l ? r(Yn, l) : i(Yn);
          var a = 0,
            s = Yn.compareStates,
            u = !1,
            f = o,
            c = !1;
          if (Zn.iter(f, Zn.size, function(e) {
              var i = e.stateAfter;
              if (+new Date > t) return _n.push(f), bn(zn.workDelay), u && ir.push({
                from: n,
                to: f + 1
              }), c = !0;
              var o = e.highlight(Yn, l, zn.tabSize);
              if (o && (u = !0), e.stateAfter = r(Yn, l), s) {
                if (i && s(i, l)) return !0
              } else if (o === !1 && i) {
                if (++a > 3 && (!Yn.indent || Yn.indent(i, "") == Yn.indent(l, ""))) return !0
              } else a = 0;
              ++f
            }), c) return;
          u && ir.push({
            from: n,
            to: f + 1
          })
        }
      }
      e && zn.onHighlightComplete && zn.onHighlightComplete(wr)
    }

    function bn(t) {
      _n.length && $n.set(t, An(Mn))
    }

    function Sn() {
      nr = rr = or = null, ir = [], lr = !1, ur = []
    }

    function Ln() {
      var t, e = !1;
      lr && (e = !we()), ir.length ? t = Se(ir, !0) : (lr && Te(), sr && ze()), e && we(), lr && (Ce(), xn()), qn && !ar && (nr === !0 || nr !== !1 && lr) && ye(rr), lr && zn.matchBrackets && setTimeout(An(function() {
        fr && (fr(), fr = null), E(hr.from, hr.to) && yn(!1)
      }), 20);
      var n = or,
        r = ur;
      lr && zn.onCursorActivity && zn.onCursorActivity(wr), n && zn.onChange && wr && zn.onChange(wr, n);
      for (var i = 0; i < r.length; ++i) r[i](wr);
      t && zn.onUpdate && zn.onUpdate(wr)
    }

    function An(t) {
      return function() {
        Hr++ || Sn();
        try {
          var e = t.apply(this, arguments)
        } finally {
          --Hr || Ln()
        }
        return e
      }
    }
    var zn = {},
      Tn = t.defaults;
    for (var En in Tn) Tn.hasOwnProperty(En) && (zn[En] = (u && u.hasOwnProperty(En) ? u : Tn)[En]);
    var Wn = zn.document,
      Nn = Wn.createElement("div");
    Nn.className = "CodeMirror" + (zn.lineWrapping ? " CodeMirror-wrap" : ""), Nn.innerHTML = '<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px;" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden"></div><pre class="CodeMirror-cursor">&#160;</pre><div></div></div></div></div></div></div>', o.appendChild ? o.appendChild(Nn) : o(Nn);
    var Dn = Nn.firstChild,
      Hn = Dn.firstChild,
      In = Nn.lastChild,
      On = In.firstChild,
      Rn = On.firstChild,
      Pn = Rn.firstChild,
      Un = Pn.firstChild,
      Bn = Pn.nextSibling.firstChild,
      Vn = Bn.firstChild,
      Kn = Vn.nextSibling,
      Fn = Kn.nextSibling;
    $e(), /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent) && (Hn.style.width = "0px"), Y || (Bn.draggable = !0), null != zn.tabindex && (Hn.tabIndex = zn.tabindex), zn.gutter || zn.lineNumbers || (Pn.style.display = "none");
    try {
      an("x")
    } catch (jn) {
      throw jn.message.match(/runtime/i) && (jn = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")), jn
    }
    var Gn, Yn, _n, qn, Xn = new S,
      $n = new S,
      Zn = new c([new f([new s("")])]);
    Ge();
    var Jn, Qn, tr, er, nr, rr, ir, or, lr, ar, sr, ur, fr, cr, hr = {
        from: {
          line: 0,
          ch: 0
        },
        to: {
          line: 0,
          ch: 0
        },
        inverted: !1
      },
      dr = !1,
      mr = 0,
      pr = 0,
      gr = 0,
      vr = 0,
      xr = "",
      yr = qe();
    An(function() {
      A(zn.value || ""), nr = !1
    })();
    var kr = new g;
    b(In, "mousedown", An(U)), b(In, "dblclick", An(_)), b(Bn, "dragstart", Q), b(Bn, "selectstart", y), j || b(In, "contextmenu", vn), b(In, "scroll", function() {
      Se([]), zn.fixedGutter && (Pn.style.left = In.scrollLeft + "px"), zn.onScroll && zn.onScroll(wr)
    }), b(window, "resize", function() {
      Se(!0)
    }), b(Hn, "keyup", An(re)), b(Hn, "input", ve), b(Hn, "keydown", An(ee)), b(Hn, "keypress", An(ne)), b(Hn, "focus", ie), b(Hn, "blur", oe), b(In, "dragenter", C), b(In, "dragover", C), b(In, "drop", An(J)), b(In, "paste", function() {
      ke(), ve()
    }), b(Hn, "paste", ve), b(Hn, "cut", An(function() {
      he("")
    }));
    var Cr;
    try {
      Cr = Wn.activeElement == Hn
    } catch (jn) {}
    Cr ? setTimeout(ie, 20) : oe();
    var wr = Nn.CodeMirror = {
        getValue: P,
        setValue: An(A),
        getSelection: pe,
        replaceSelection: An(he),
        focus: function() {
          ke(), ie(), ve()
        },
        setOption: function(t, e) {
          var n = zn[t];
          zn[t] = e, "mode" == t || "indentUnit" == t ? Ge() : "readOnly" == t && e ? (oe(), Hn.blur()) : "theme" == t ? $e() : "lineWrapping" == t && n != e ? An(_e)() : "tabSize" == t && An(Xe)(), ("lineNumbers" == t || "gutter" == t || "firstLineNumber" == t || "theme" == t) && An(Ye)()
        },
        getOption: function(t) {
          return zn[t]
        },
        undo: An(se),
        redo: An(ue),
        indentLine: An(function(t, e) {
          v(t) && je(t, null == e ? "smart" : e ? "add" : "subtract")
        }),
        indentSelection: An(Fe),
        historySize: function() {
          return {
            undo: kr.done.length,
            redo: kr.undone.length
          }
        },
        clearHistory: function() {
          kr = new g
        },
        matchBrackets: An(function() {
          yn(!0)
        }),
        getTokenAt: An(function(t) {
          return t = Oe(t), k(t.line).getTokenAt(Yn, Cn(t.line), t.ch)
        }),
        getStateAfter: function(t) {
          return t = Ie(null == t ? Zn.size - 1 : t), Cn(t + 1)
        },
        cursorCoords: function(t) {
          return null == t && (t = hr.inverted), cn(t ? hr.from : hr.to)
        },
        charCoords: function(t) {
          return cn(Oe(t))
        },
        coordsChar: function(t) {
          var e = z(Bn);
          return fn(t.x - e.left, t.y - e.top)
        },
        markText: An(Je),
        setBookmark: Qe,
        setMarker: An(tn),
        clearMarker: An(en),
        setLineClass: An(rn),
        hideLine: An(function(t) {
          return on(t, !0)
        }),
        showLine: An(function(t) {
          return on(t, !1)
        }),
        onDeleteLine: function(t, e) {
          if ("number" == typeof t) {
            if (!v(t)) return null;
            t = k(t)
          }
          return (t.handlers || (t.handlers = [])).push(e), t
        },
        lineInfo: ln,
        addWidget: function(t, e, n, r, i) {
          t = un(Oe(t));
          var o = t.yBot,
            l = t.x;
          if (e.style.position = "absolute", On.appendChild(e), "over" == r) o = t.y;
          else if ("near" == r) {
            var a = Math.max(In.offsetHeight, Zn.height * hn()),
              s = Math.max(On.clientWidth, Bn.clientWidth) - pn();
            t.yBot + e.offsetHeight > a && t.y > e.offsetHeight && (o = t.y - e.offsetHeight), l + e.offsetWidth > s && (l = s - e.offsetWidth)
          }
          e.style.top = o + mn() + "px", e.style.left = e.style.right = "", "right" == i ? (l = On.clientWidth - e.offsetWidth, e.style.right = "0px") : ("left" == i ? l = 0 : "middle" == i && (l = (On.clientWidth - e.offsetWidth) / 2), e.style.left = l + pn() + "px"), n && Me(l, o, l + e.offsetWidth, o + e.offsetHeight)
        },
        lineCount: function() {
          return Zn.size
        },
        clipPos: Oe,
        getCursor: function(t) {
          return null == t && (t = hr.inverted), N(t ? hr.from : hr.to)
        },
        somethingSelected: function() {
          return !E(hr.from, hr.to)
        },
        setCursor: An(function(t, e, n) {
          null == e && "number" == typeof t.line ? He(t.line, t.ch, n) : He(t, e, n)
        }),
        setSelection: An(function(t, e, n) {
          (n ? We : Ne)(Oe(t), Oe(e || t))
        }),
        getLine: function(t) {
          return v(t) ? k(t).text : void 0
        },
        getLineHandle: function(t) {
          return v(t) ? k(t) : void 0
        },
        setLine: An(function(t, e) {
          v(t) && ce(e, {
            line: t,
            ch: 0
          }, {
            line: t,
            ch: k(t).text.length
          })
        }),
        removeLine: An(function(t) {
          v(t) && ce("", {
            line: t,
            ch: 0
          }, Oe({
            line: t + 1,
            ch: 0
          }))
        }),
        replaceRange: An(ce),
        getRange: function(t, e) {
          return me(Oe(t), Oe(e))
        },
        execCommand: function(t) {
          return V[t](wr)
        },
        moveH: An(Pe),
        deleteH: An(Ue),
        moveV: An(Be),
        toggleOverwrite: function() {
          dr = !dr
        },
        posFromIndex: function(t) {
          var e, n = 0;
          return Zn.iter(0, Zn.size, function(r) {
            var i = r.text.length + 1;
            return i > t ? (e = t, !0) : (t -= i, void++n)
          }), Oe({
            line: n,
            ch: e
          })
        },
        indexFromPos: function(t) {
          if (t.line < 0 || t.ch < 0) return 0;
          var e = t.ch;
          return Zn.iter(0, t.line, function(t) {
            e += t.text.length + 1
          }), e
        },
        operation: function(t) {
          return An(t)()
        },
        refresh: function() {
          Se(!0)
        },
        getInputField: function() {
          return Hn
        },
        getWrapperElement: function() {
          return Nn
        },
        getScrollerElement: function() {
          return In
        },
        getGutterElement: function() {
          return Pn
        }
      },
      Mr = null,
      br = !1,
      Sr = "",
      Lr = null;
    Ze.prototype.clear = An(function() {
      for (var t = 1 / 0, e = -1 / 0, n = 0, r = this.set.length; r > n; ++n) {
        var i = this.set[n],
          o = i.marked;
        if (o && i.parent) {
          var l = d(i);
          t = Math.min(t, l), e = Math.max(e, l);
          for (var a = 0; a < o.length; ++a) o[a].set == this.set && o.splice(a--, 1)
        }
      }
      1 / 0 != t && ir.push({
        from: t,
        to: e + 1
      })
    }), Ze.prototype.find = function() {
      for (var t, e, n = 0, r = this.set.length; r > n; ++n)
        for (var i = this.set[n], o = i.marked, l = 0; l < o.length; ++l) {
          var a = o[l];
          if (a.set == this.set && (null != a.from || null != a.to)) {
            var s = d(i);
            null != s && (null != a.from && (t = {
              line: s,
              ch: a.from
            }), null != a.to && (e = {
              line: s,
              ch: a.to
            }))
          }
        }
      return {
        from: t,
        to: e
      }
    };
    var Ar, zr, Tr, Er, Wr = Math.floor(16777215 * Math.random()).toString(16),
      Nr = 0,
      Dr = {
        "(": ")>",
        ")": "(<",
        "[": "]>",
        "]": "[<",
        "{": "}>",
        "}": "{<"
      },
      Hr = 0;
    for (var Ir in B) B.propertyIsEnumerable(Ir) && !wr.propertyIsEnumerable(Ir) && (wr[Ir] = B[Ir]);
    return wr
  }

  function e(t, e, n) {
    function r(t, e, n) {
      var i = e[t];
      if (null != i) return i;
      if (null == n && (n = e.fallthrough), null == n) return e.catchall;
      if ("string" == typeof n) return r(t, K[n]);
      for (var o = 0, l = n.length; l > o; ++o)
        if (i = r(t, K[n[o]]), null != i) return i;
      return null
    }
    return e ? r(t, e, n) : r(t, K[n])
  }

  function n(t) {
    var e = Z[t.keyCode];
    return "Ctrl" == e || "Alt" == e || "Shift" == e || "Mod" == e
  }

  function r(t, e) {
    if (e === !0) return e;
    if (t.copyState) return t.copyState(e);
    var n = {};
    for (var r in e) {
      var i = e[r];
      i instanceof Array && (i = i.concat([])), n[r] = i
    }
    return n
  }

  function i(t, e, n) {
    return t.startState ? t.startState(e, n) : !0
  }

  function o(t, e) {
    this.pos = this.start = 0, this.string = t, this.tabSize = e || 8
  }

  function l(t, e, n, r) {
    this.from = t, this.to = e, this.style = n, this.set = r
  }

  function a(t) {
    this.from = t, this.to = t, this.line = null
  }

  function s(t, e) {
    this.styles = e || [t, null], this.text = t, this.height = 1, this.marked = this.gutterMarker = this.className = this.handlers = null, this.stateAfter = this.parent = this.hidden = null
  }

  function u(t, e, n, r) {
    for (var i = 0, o = 0, l = 0; e > o; i += 2) {
      var a = n[i],
        s = o + a.length;
      0 == l ? (s > t && r.push(a.slice(t - o, Math.min(a.length, e - o)), n[i + 1]), s >= t && (l = 1)) : 1 == l && (s > e ? r.push(a.slice(0, e - o), n[i + 1]) : r.push(a, n[i + 1])), o = s
    }
  }

  function f(t) {
    this.lines = t, this.parent = null;
    for (var e = 0, n = t.length, r = 0; n > e; ++e) t[e].parent = this, r += t[e].height;
    this.height = r
  }

  function c(t) {
    this.children = t;
    for (var e = 0, n = 0, r = 0, i = t.length; i > r; ++r) {
      var o = t[r];
      e += o.chunkSize(), n += o.height, o.parent = this
    }
    this.size = e, this.height = n, this.parent = null
  }

  function h(t, e) {
    for (; !t.lines;)
      for (var n = 0;; ++n) {
        var r = t.children[n],
          i = r.chunkSize();
        if (i > e) {
          t = r;
          break
        }
        e -= i
      }
    return t.lines[e]
  }

  function d(t) {
    if (null == t.parent) return null;
    for (var e = t.parent, n = I(e.lines, t), r = e.parent; r; e = r, r = r.parent) {
      var i = 0;
      for (r.children.length; r.children[i] != e; ++i) n += r.children[i].chunkSize()
    }
    return n
  }

  function m(t, e) {
    var n = 0;
    t: do {
      for (var r = 0, i = t.children.length; i > r; ++r) {
        var o = t.children[r],
          l = o.height;
        if (l > e) {
          t = o;
          continue t
        }
        e -= l, n += o.chunkSize()
      }
      return n
    } while (!t.lines);
    for (var r = 0, i = t.lines.length; i > r; ++r) {
      var a = t.lines[r],
        s = a.height;
      if (s > e) break;
      e -= s
    }
    return n + r
  }

  function p(t, e) {
    var n = 0;
    t: do {
      for (var r = 0, i = t.children.length; i > r; ++r) {
        var o = t.children[r],
          l = o.chunkSize();
        if (l > e) {
          t = o;
          continue t
        }
        e -= l, n += o.height
      }
      return n
    } while (!t.lines);
    for (var r = 0; e > r; ++r) n += t.lines[r].height;
    return n
  }

  function g() {
    this.time = 0, this.done = [], this.undone = []
  }

  function v() {
    C(this)
  }

  function x(t) {
    return t.stop || (t.stop = v), t
  }

  function y(t) {
    t.preventDefault ? t.preventDefault() : t.returnValue = !1
  }

  function k(t) {
    t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0
  }

  function C(t) {
    y(t), k(t)
  }

  function w(t) {
    return t.target || t.srcElement
  }

  function M(t) {
    return t.which ? t.which : 1 & t.button ? 1 : 2 & t.button ? 3 : 4 & t.button ? 2 : void 0
  }

  function b(t, e, n, r) {
    if ("function" == typeof t.addEventListener) {
      if (t.addEventListener(e, n, !1), r) return function() {
        t.removeEventListener(e, n, !1)
      }
    } else {
      var i = function(t) {
        n(t || window.event)
      };
      if (t.attachEvent("on" + e, i), r) return function() {
        t.detachEvent("on" + e, i)
      }
    }
  }

  function S() {
    this.id = null
  }

  function L(t, e, n) {
    null == e && (e = t.search(/[^\s\u00a0]/), -1 == e && (e = t.length));
    for (var r = 0, i = 0; e > r; ++r) "	" == t.charAt(r) ? i += n - i % n : ++i;
    return i
  }

  function A(t) {
    return t.currentStyle ? t.currentStyle : window.getComputedStyle(t, null)
  }

  function z(t, e) {
    for (var n = t.ownerDocument.body, r = 0, i = 0, o = !1, l = t; l; l = l.offsetParent) {
      var a = l.offsetLeft,
        s = l.offsetTop;
      l == n ? (r += Math.abs(a), i += Math.abs(s)) : (r += a, i += s), e && "fixed" == A(l).position && (o = !0)
    }
    for (var u = e && !o ? null : n, l = t.parentNode; l != u; l = l.parentNode) null != l.scrollLeft && (r -= l.scrollLeft, i -= l.scrollTop);
    return {
      left: r,
      top: i
    }
  }

  function T(t) {
    return t.textContent || t.innerText || t.nodeValue || ""
  }

  function E(t, e) {
    return t.line == e.line && t.ch == e.ch
  }

  function W(t, e) {
    return t.line < e.line || t.line == e.line && t.ch < e.ch
  }

  function N(t) {
    return {
      line: t.line,
      ch: t.ch
    }
  }

  function D(t) {
    return q.textContent = t, q.innerHTML
  }

  function H(t, e) {
    if (!e) return t ? t.length : 0;
    if (!t) return e.length;
    for (var n = t.length, r = e.length; n >= 0 && r >= 0 && t.charAt(n) == e.charAt(r); --n, --r);
    return r + 1
  }

  function I(t, e) {
    if (t.indexOf) return t.indexOf(e);
    for (var n = 0, r = t.length; r > n; ++n)
      if (t[n] == e) return n;
    return -1
  }

  function O(t) {
    return /\w/.test(t) || t.toUpperCase() != t.toLowerCase()
  }
  t.defaults = {
    value: "",
    mode: null,
    theme: "default",
    indentUnit: 2,
    indentWithTabs: !1,
    tabSize: 4,
    keyMap: "default",
    extraKeys: null,
    electricChars: !0,
    onKeyEvent: null,
    lineWrapping: !1,
    lineNumbers: !1,
    gutter: !1,
    fixedGutter: !1,
    firstLineNumber: 1,
    readOnly: !1,
    onChange: null,
    onCursorActivity: null,
    onGutterClick: null,
    onHighlightComplete: null,
    onUpdate: null,
    onFocus: null,
    onBlur: null,
    onScroll: null,
    matchBrackets: !1,
    workTime: 100,
    workDelay: 200,
    pollInterval: 100,
    undoDepth: 40,
    tabindex: null,
    document: window.document
  };
  var R = /Mac/.test(navigator.platform),
    P = (/Win/.test(navigator.platform), {}),
    U = {};
  t.defineMode = function(e, n) {
    t.defaults.mode || "null" == e || (t.defaults.mode = e), P[e] = n
  }, t.defineMIME = function(t, e) {
    U[t] = e
  }, t.getMode = function(e, n) {
    if ("string" == typeof n && U.hasOwnProperty(n) && (n = U[n]), "string" == typeof n) var r = n,
      i = {};
    else if (null != n) var r = n.name,
      i = n;
    var o = P[r];
    return o ? o(e, i || {}) : (window.console && console.warn("No mode " + r + " found, falling back to plain text."), t.getMode(e, "text/plain"))
  }, t.listModes = function() {
    var t = [];
    for (var e in P) P.propertyIsEnumerable(e) && t.push(e);
    return t
  }, t.listMIMEs = function() {
    var t = [];
    for (var e in U) U.propertyIsEnumerable(e) && t.push({
      mime: e,
      mode: U[e]
    });
    return t
  };
  var B = t.extensions = {};
  t.defineExtension = function(t, e) {
    B[t] = e
  };
  var V = t.commands = {
      selectAll: function(t) {
        t.setSelection({
          line: 0,
          ch: 0
        }, {
          line: t.lineCount() - 1
        })
      },
      killLine: function(t) {
        var e = t.getCursor(!0),
          n = t.getCursor(!1),
          r = !E(e, n);
        r || t.getLine(e.line).length != e.ch ? t.replaceRange("", e, r ? n : {
          line: e.line
        }) : t.replaceRange("", e, {
          line: e.line + 1,
          ch: 0
        })
      },
      deleteLine: function(t) {
        var e = t.getCursor().line;
        t.replaceRange("", {
          line: e,
          ch: 0
        }, {
          line: e
        })
      },
      undo: function(t) {
        t.undo()
      },
      redo: function(t) {
        t.redo()
      },
      goDocStart: function(t) {
        t.setCursor(0, 0, !0)
      },
      goDocEnd: function(t) {
        t.setSelection({
          line: t.lineCount() - 1
        }, null, !0)
      },
      goLineStart: function(t) {
        t.setCursor(t.getCursor().line, 0, !0)
      },
      goLineStartSmart: function(t) {
        var e = t.getCursor(),
          n = t.getLine(e.line),
          r = Math.max(0, n.search(/\S/));
        t.setCursor(e.line, e.ch <= r && e.ch ? 0 : r, !0)
      },
      goLineEnd: function(t) {
        t.setSelection({
          line: t.getCursor().line
        }, null, !0)
      },
      goLineUp: function(t) {
        t.moveV(-1, "line")
      },
      goLineDown: function(t) {
        t.moveV(1, "line")
      },
      goPageUp: function(t) {
        t.moveV(-1, "page")
      },
      goPageDown: function(t) {
        t.moveV(1, "page")
      },
      goCharLeft: function(t) {
        t.moveH(-1, "char")
      },
      goCharRight: function(t) {
        t.moveH(1, "char")
      },
      goColumnLeft: function(t) {
        t.moveH(-1, "column")
      },
      goColumnRight: function(t) {
        t.moveH(1, "column")
      },
      goWordLeft: function(t) {
        t.moveH(-1, "word")
      },
      goWordRight: function(t) {
        t.moveH(1, "word")
      },
      delCharLeft: function(t) {
        t.deleteH(-1, "char")
      },
      delCharRight: function(t) {
        t.deleteH(1, "char")
      },
      delWordLeft: function(t) {
        t.deleteH(-1, "word")
      },
      delWordRight: function(t) {
        t.deleteH(1, "word")
      },
      indentAuto: function(t) {
        t.indentSelection("smart")
      },
      indentMore: function(t) {
        t.indentSelection("add")
      },
      indentLess: function(t) {
        t.indentSelection("subtract")
      },
      insertTab: function(t) {
        t.replaceSelection("	", "end")
      },
      transposeChars: function(t) {
        var e = t.getCursor(),
          n = t.getLine(e.line);
        e.ch > 0 && e.ch < n.length - 1 && t.replaceRange(n.charAt(e.ch) + n.charAt(e.ch - 1), {
          line: e.line,
          ch: e.ch - 1
        }, {
          line: e.line,
          ch: e.ch + 1
        })
      },
      newlineAndIndent: function(t) {
        t.replaceSelection("\n", "end"), t.indentLine(t.getCursor().line)
      },
      toggleOverwrite: function(t) {
        t.toggleOverwrite()
      }
    },
    K = t.keyMap = {};
  K.basic = {
    Left: "goCharLeft",
    Right: "goCharRight",
    Up: "goLineUp",
    Down: "goLineDown",
    End: "goLineEnd",
    Home: "goLineStartSmart",
    PageUp: "goPageUp",
    PageDown: "goPageDown",
    Delete: "delCharRight",
    Backspace: "delCharLeft",
    Tab: "indentMore",
    "Shift-Tab": "indentLess",
    Enter: "newlineAndIndent",
    Insert: "toggleOverwrite"
  }, K.pcDefault = {
    "Ctrl-A": "selectAll",
    "Ctrl-D": "deleteLine",
    "Ctrl-Z": "undo",
    "Shift-Ctrl-Z": "redo",
    "Ctrl-Y": "redo",
    "Ctrl-Home": "goDocStart",
    "Alt-Up": "goDocStart",
    "Ctrl-End": "goDocEnd",
    "Ctrl-Down": "goDocEnd",
    "Ctrl-Left": "goWordLeft",
    "Ctrl-Right": "goWordRight",
    "Alt-Left": "goLineStart",
    "Alt-Right": "goLineEnd",
    "Ctrl-Backspace": "delWordLeft",
    "Ctrl-Delete": "delWordRight",
    "Ctrl-S": "save",
    "Ctrl-F": "find",
    "Ctrl-G": "findNext",
    "Shift-Ctrl-G": "findPrev",
    "Shift-Ctrl-F": "replace",
    "Shift-Ctrl-R": "replaceAll",
    fallthrough: "basic"
  }, K.macDefault = {
    "Cmd-A": "selectAll",
    "Cmd-D": "deleteLine",
    "Cmd-Z": "undo",
    "Shift-Cmd-Z": "redo",
    "Cmd-Y": "redo",
    "Cmd-Up": "goDocStart",
    "Cmd-End": "goDocEnd",
    "Cmd-Down": "goDocEnd",
    "Alt-Left": "goWordLeft",
    "Alt-Right": "goWordRight",
    "Cmd-Left": "goLineStart",
    "Cmd-Right": "goLineEnd",
    "Alt-Backspace": "delWordLeft",
    "Ctrl-Alt-Backspace": "delWordRight",
    "Alt-Delete": "delWordRight",
    "Cmd-S": "save",
    "Cmd-F": "find",
    "Cmd-G": "findNext",
    "Shift-Cmd-G": "findPrev",
    "Cmd-Alt-F": "replace",
    "Shift-Cmd-Alt-F": "replaceAll",
    fallthrough: ["basic", "emacsy"]
  }, K["default"] = R ? K.macDefault : K.pcDefault, K.emacsy = {
    "Ctrl-F": "goCharRight",
    "Ctrl-B": "goCharLeft",
    "Ctrl-P": "goLineUp",
    "Ctrl-N": "goLineDown",
    "Alt-F": "goWordRight",
    "Alt-B": "goWordLeft",
    "Ctrl-A": "goLineStart",
    "Ctrl-E": "goLineEnd",
    "Ctrl-V": "goPageUp",
    "Shift-Ctrl-V": "goPageDown",
    "Ctrl-D": "delCharRight",
    "Ctrl-H": "delCharLeft",
    "Alt-D": "delWordRight",
    "Alt-Backspace": "delWordLeft",
    "Ctrl-K": "killLine",
    "Ctrl-T": "transposeChars"
  }, t.fromTextArea = function(e, n) {
    function r() {
      e.value = a.getValue()
    }

    function i() {
      r(), e.form.submit = l, e.form.submit(), e.form.submit = i
    }
    if (n || (n = {}), n.value = e.value, !n.tabindex && e.tabindex && (n.tabindex = e.tabindex), e.form) {
      var o = b(e.form, "submit", r, !0);
      if ("function" == typeof e.form.submit) {
        var l = e.form.submit;
        e.form.submit = i
      }
    }
    e.style.display = "none";
    var a = t(function(t) {
      e.parentNode.insertBefore(t, e.nextSibling)
    }, n);
    return a.save = r, a.getTextArea = function() {
      return e
    }, a.toTextArea = function() {
      r(), e.parentNode.removeChild(a.getWrapperElement()), e.style.display = "", e.form && (o(), "function" == typeof e.form.submit && (e.form.submit = l))
    }, a
  }, t.copyState = r, t.startState = i, o.prototype = {
    eol: function() {
      return this.pos >= this.string.length
    },
    sol: function() {
      return 0 == this.pos
    },
    peek: function() {
      return this.string.charAt(this.pos)
    },
    next: function() {
      return this.pos < this.string.length ? this.string.charAt(this.pos++) : void 0
    },
    eat: function(t) {
      var e = this.string.charAt(this.pos);
      if ("string" == typeof t) var n = e == t;
      else var n = e && (t.test ? t.test(e) : t(e));
      return n ? (++this.pos, e) : void 0
    },
    eatWhile: function(t) {
      for (var e = this.pos; this.eat(t););
      return this.pos > e
    },
    eatSpace: function() {
      for (var t = this.pos;
        /[\s\u00a0]/.test(this.string.charAt(this.pos));) ++this.pos;
      return this.pos > t
    },
    skipToEnd: function() {
      this.pos = this.string.length
    },
    skipTo: function(t) {
      var e = this.string.indexOf(t, this.pos);
      return e > -1 ? (this.pos = e, !0) : void 0
    },
    backUp: function(t) {
      this.pos -= t
    },
    column: function() {
      return L(this.string, this.start, this.tabSize)
    },
    indentation: function() {
      return L(this.string, null, this.tabSize)
    },
    match: function(t, e, n) {
      function r(t) {
        return n ? t.toLowerCase() : t
      }
      if ("string" != typeof t) {
        var i = this.string.slice(this.pos).match(t);
        return i && e !== !1 && (this.pos += i[0].length), i
      }
      return r(this.string).indexOf(r(t), this.pos) == this.pos ? (e !== !1 && (this.pos += t.length), !0) : void 0
    },
    current: function() {
      return this.string.slice(this.start, this.pos)
    }
  }, t.StringStream = o, l.prototype = {
    attach: function(t) {
      this.set.push(t)
    },
    detach: function(t) {
      var e = I(this.set, t);
      e > -1 && this.set.splice(e, 1)
    },
    split: function(t, e) {
      if (this.to <= t && null != this.to) return null;
      var n = this.from < t || null == this.from ? null : this.from - t + e,
        r = null == this.to ? null : this.to - t + e;
      return new l(n, r, this.style, this.set)
    },
    dup: function() {
      return new l(null, null, this.style, this.set)
    },
    clipTo: function(t, e, n, r, i) {
      null != this.from && this.from >= e && (this.from = Math.max(r, this.from) + i), null != this.to && this.to > e && (this.to = r < this.to ? this.to + i : e), t && r > this.from && (r < this.to || null == this.to) && (this.from = null), n && (e < this.to || null == this.to) && (e > this.from || null == this.from) && (this.to = null)
    },
    isDead: function() {
      return null != this.from && null != this.to && this.from >= this.to
    },
    sameSet: function(t) {
      return this.set == t.set
    }
  }, a.prototype = {
    attach: function(t) {
      this.line = t
    },
    detach: function(t) {
      this.line == t && (this.line = null)
    },
    split: function(t, e) {
      return t < this.from ? (this.from = this.to = this.from - t + e, this) : void 0
    },
    isDead: function() {
      return this.from > this.to
    },
    clipTo: function(t, e, n, r, i) {
      (t || e < this.from) && (n || r > this.to) ? (this.from = 0, this.to = -1) : this.from > e && (this.from = this.to = Math.max(r, this.from) + i)
    },
    sameSet: function() {
      return !1
    },
    find: function() {
      return this.line && this.line.parent ? {
        line: d(this.line),
        ch: this.from
      } : null
    },
    clear: function() {
      if (this.line) {
        var t = I(this.line.marked, this); - 1 != t && this.line.marked.splice(t, 1), this.line = null
      }
    }
  }, s.inheritMarks = function(t, e) {
    var n = new s(t),
      r = e && e.marked;
    if (r)
      for (var i = 0; i < r.length; ++i)
        if (null == r[i].to && r[i].style) {
          var o = n.marked || (n.marked = []),
            l = r[i],
            a = l.dup();
          o.push(a), a.attach(n)
        } return n
  }, s.prototype = {
    replace: function(t, e, n) {
      var r = [],
        i = this.marked,
        o = null == e ? this.text.length : e;
      if (u(0, t, this.styles, r), n && r.push(n, null), u(o, this.text.length, this.styles, r), this.styles = r, this.text = this.text.slice(0, t) + n + this.text.slice(o), this.stateAfter = null, i)
        for (var l = n.length - (o - t), a = 0, s = i[a]; a < i.length; ++a) s.clipTo(null == t, t || 0, null == e, o, l), s.isDead() && (s.detach(this), i.splice(a--, 1))
    },
    split: function(t, e) {
      var n = [e, null],
        r = this.marked;
      u(t, this.text.length, this.styles, n);
      var i = new s(e + this.text.slice(t), n);
      if (r)
        for (var o = 0; o < r.length; ++o) {
          var l = r[o],
            a = l.split(t, e.length);
          a && (i.marked || (i.marked = []), i.marked.push(a), a.attach(i))
        }
      return i
    },
    append: function(t) {
      var e = this.text.length,
        n = t.marked,
        r = this.marked;
      if (this.text += t.text, u(0, t.text.length, t.styles, this.styles), r)
        for (var i = 0; i < r.length; ++i) null == r[i].to && (r[i].to = e);
      if (n && n.length) {
        r || (this.marked = r = []);
        t: for (var i = 0; i < n.length; ++i) {
          var o = n[i];
          if (!o.from)
            for (var l = 0; l < r.length; ++l) {
              var a = r[l];
              if (a.to == e && a.sameSet(o)) {
                a.to = null == o.to ? null : o.to + e, a.isDead() && (a.detach(this), n.splice(i--, 1));
                continue t
              }
            }
          r.push(o), o.attach(this), o.from += e, null != o.to && (o.to += e)
        }
      }
    },
    fixMarkEnds: function(t) {
      var e = this.marked,
        n = t.marked;
      if (e)
        for (var r = 0; r < e.length; ++r) {
          var i = e[r],
            o = null == i.to;
          if (o && n)
            for (var l = 0; l < n.length; ++l)
              if (n[l].sameSet(i)) {
                o = !1;
                break
              } o && (i.to = this.text.length)
        }
    },
    fixMarkStarts: function() {
      var t = this.marked;
      if (t)
        for (var e = 0; e < t.length; ++e) null == t[e].from && (t[e].from = 0)
    },
    addMark: function(t) {
      t.attach(this), null == this.marked && (this.marked = []), this.marked.push(t), this.marked.sort(function(t, e) {
        return (t.from || 0) - (e.from || 0)
      })
    },
    highlight: function(t, e, n) {
      var r, i = new o(this.text, n),
        l = this.styles,
        a = 0,
        s = !1,
        u = l[0];
      for ("" == this.text && t.blankLine && t.blankLine(e); !i.eol();) {
        var f = t.token(i, e),
          c = this.text.slice(i.start, i.pos);
        if (i.start = i.pos, a && l[a - 1] == f ? l[a - 2] += c : c && (!s && (l[a + 1] != f || a && l[a - 2] != r) && (s = !0), l[a++] = c, l[a++] = f, r = u, u = l[a]), i.pos > 5e3) {
          l[a++] = this.text.slice(i.pos), l[a++] = null;
          break
        }
      }
      return l.length != a && (l.length = a, s = !0), a && l[a - 2] != r && (s = !0), s || (l.length < 5 && this.text.length < 10 ? null : !1)
    },
    getTokenAt: function(t, e, n) {
      for (var r = this.text, i = new o(r); i.pos < n && !i.eol();) {
        i.start = i.pos;
        var l = t.token(i, e)
      }
      return {
        start: i.start,
        end: i.pos,
        string: i.current(),
        className: l || null,
        state: e
      }
    },
    indentation: function(t) {
      return L(this.text, null, t)
    },
    getHTML: function(t, e, n, r, i) {
      function o(t, e) {
        t && (s && G && " " == t.charAt(0) && (t = " " + t.slice(1)), s = !1, e ? a.push('<span class="', e, '">', D(t).replace(/\t/g, r), "</span>") : a.push(D(t).replace(/\t/g, r)))
      }

      function l() {
        c && (v += 1, x = v < c.length ? c[v] : null)
      }
      var a = [],
        s = !0;
      n && a.push(this.className ? '<pre class="' + this.className + '">' : "<pre>");
      var u = this.styles,
        f = this.text,
        c = this.marked;
      t == e && (t = null);
      var h = f.length;
      if (null != i && (h = Math.min(i, h)), f || null != i)
        if (c || null != t) {
          var d, m = 0,
            p = 0,
            g = "",
            v = -1,
            x = null;
          for (l(); h > m;) {
            var y = h,
              k = "";
            for (null != t && (t > m ? y = t : (null == e || e > m) && (k = " CodeMirror-selected", null != e && (y = Math.min(y, e)))); x && null != x.to && x.to <= m;) l();
            for (x && (x.from > m ? y = Math.min(y, x.from) : (k += " " + x.style, null != x.to && (y = Math.min(y, x.to))));;) {
              var C = m + g.length,
                w = d;
              if (k && (w = d ? d + k : k), o(C > y ? g.slice(0, y - m) : g, w), C >= y) {
                g = g.slice(y - m), m = y;
                break
              }
              m = C, g = u[p++], d = "cm-" + u[p++]
            }
          }
          null != t && null == e && o(" ", "CodeMirror-selected")
        } else
          for (var p = 0, M = 0; h > M; p += 2) {
            var b = u[p],
              d = u[p + 1],
              S = b.length;
            M + S > h && (b = b.slice(0, h - M)), M += S, o(b, d && "cm-" + d)
          } else o(" ", null != t && null == e ? "CodeMirror-selected" : null);
      return n && a.push("</pre>"), a.join("")
    },
    cleanUp: function() {
      if (this.parent = null, this.marked)
        for (var t = 0, e = this.marked.length; e > t; ++t) this.marked[t].detach(this)
    }
  }, f.prototype = {
    chunkSize: function() {
      return this.lines.length
    },
    remove: function(t, e, n) {
      for (var r = t, i = t + e; i > r; ++r) {
        var o = this.lines[r];
        if (this.height -= o.height, o.cleanUp(), o.handlers)
          for (var l = 0; l < o.handlers.length; ++l) n.push(o.handlers[l])
      }
      this.lines.splice(t, e)
    },
    collapse: function(t) {
      t.splice.apply(t, [t.length, 0].concat(this.lines))
    },
    insertHeight: function(t, e, n) {
      this.height += n, this.lines.splice.apply(this.lines, [t, 0].concat(e));
      for (var r = 0, i = e.length; i > r; ++r) e[r].parent = this
    },
    iterN: function(t, e, n) {
      for (var r = t + e; r > t; ++t)
        if (n(this.lines[t])) return !0
    }
  }, c.prototype = {
    chunkSize: function() {
      return this.size
    },
    remove: function(t, e, n) {
      this.size -= e;
      for (var r = 0; r < this.children.length; ++r) {
        var i = this.children[r],
          o = i.chunkSize();
        if (o > t) {
          var l = Math.min(e, o - t),
            a = i.height;
          if (i.remove(t, l, n), this.height -= a - i.height, o == l && (this.children.splice(r--, 1), i.parent = null), 0 == (e -= l)) break;
          t = 0
        } else t -= o
      }
      if (this.size - e < 25) {
        var s = [];
        this.collapse(s), this.children = [new f(s)]
      }
    },
    collapse: function(t) {
      for (var e = 0, n = this.children.length; n > e; ++e) this.children[e].collapse(t)
    },
    insert: function(t, e) {
      for (var n = 0, r = 0, i = e.length; i > r; ++r) n += e[r].height;
      this.insertHeight(t, e, n)
    },
    insertHeight: function(t, e, n) {
      this.size += e.length, this.height += n;
      for (var r = 0, i = this.children.length; i > r; ++r) {
        var o = this.children[r],
          l = o.chunkSize();
        if (l >= t) {
          if (o.insertHeight(t, e, n), o.lines && o.lines.length > 50) {
            for (; o.lines.length > 50;) {
              var a = o.lines.splice(o.lines.length - 25, 25),
                s = new f(a);
              o.height -= s.height, this.children.splice(r + 1, 0, s), s.parent = this
            }
            this.maybeSpill()
          }
          break
        }
        t -= l
      }
    },
    maybeSpill: function() {
      if (!(this.children.length <= 10)) {
        var t = this;
        do {
          var e = t.children.splice(t.children.length - 5, 5),
            n = new c(e);
          if (t.parent) {
            t.size -= n.size, t.height -= n.height;
            var r = I(t.parent.children, t);
            t.parent.children.splice(r + 1, 0, n)
          } else {
            var i = new c(t.children);
            i.parent = t, t.children = [i, n], t = i
          }
          n.parent = t.parent
        } while (t.children.length > 10);
        t.parent.maybeSpill()
      }
    },
    iter: function(t, e, n) {
      this.iterN(t, e - t, n)
    },
    iterN: function(t, e, n) {
      for (var r = 0, i = this.children.length; i > r; ++r) {
        var o = this.children[r],
          l = o.chunkSize();
        if (l > t) {
          var a = Math.min(e, l - t);
          if (o.iterN(t, a, n)) return !0;
          if (0 == (e -= a)) break;
          t = 0
        } else t -= l
      }
    }
  }, g.prototype = {
    addChange: function(t, e, n) {
      this.undone.length = 0;
      var r = +new Date,
        i = this.done[this.done.length - 1];
      if (r - this.time > 400 || !i || i.start > t + e || i.start + i.added < t - i.added + i.old.length) this.done.push({
        start: t,
        added: e,
        old: n
      });
      else {
        var o = 0;
        if (t < i.start) {
          for (var l = i.start - t - 1; l >= 0; --l) i.old.unshift(n[l]);
          i.added += i.start - t, i.start = t
        } else i.start < t && (o = t - i.start, e += o);
        for (var l = i.added - o, a = n.length; a > l; ++l) i.old.push(n[l]);
        i.added < e && (i.added = e)
      }
      this.time = r
    }
  }, t.e_stop = C, t.e_preventDefault = y, t.e_stopPropagation = k, t.connect = b, S.prototype = {
    set: function(t, e) {
      clearTimeout(this.id), this.id = setTimeout(e, t)
    }
  };
  var F = function() {
      if (/MSIE [1-8]\b/.test(navigator.userAgent)) return !1;
      var t = document.createElement("div");
      return "draggable" in t
    }(),
    j = /gecko\/\d{7}/i.test(navigator.userAgent),
    G = /MSIE \d/.test(navigator.userAgent),
    Y = /WebKit\//.test(navigator.userAgent),
    _ = "\n";
  ! function() {
    var t = document.createElement("textarea");
    t.value = "foo\nbar", t.value.indexOf("\r") > -1 && (_ = "\r\n")
  }(), null != document.documentElement.getBoundingClientRect && (z = function(t, e) {
    try {
      var n = t.getBoundingClientRect();
      n = {
        top: n.top,
        left: n.left
      }
    } catch (r) {
      n = {
        top: 0,
        left: 0
      }
    }
    if (!e)
      if (null == window.pageYOffset) {
        var i = document.documentElement || document.body.parentNode;
        null == i.scrollTop && (i = document.body), n.top += i.scrollTop, n.left += i.scrollLeft
      } else n.top += window.pageYOffset, n.left += window.pageXOffset;
    return n
  });
  var q = document.createElement("pre");
  "\na" == D("a") ? D = function(t) {
    return q.textContent = t, q.innerHTML.slice(1)
  } : "	" != D("	") && (D = function(t) {
    return q.innerHTML = "", q.appendChild(document.createTextNode(t)), q.innerHTML
  }), t.htmlEscape = D;
  var X = 3 != "\n\nb".split(/\n/).length ? function(t) {
    for (var e, n = 0, r = [];
      (e = t.indexOf("\n", n)) > -1;) r.push(t.slice(n, "\r" == t.charAt(e - 1) ? e - 1 : e)), n = e + 1;
    return r.push(t.slice(n)), r
  } : function(t) {
    return t.split(/\r?\n/)
  };
  t.splitLines = X;
  var $ = window.getSelection ? function(t) {
    try {
      return t.selectionStart != t.selectionEnd
    } catch (e) {
      return !1
    }
  } : function(t) {
    try {
      var e = t.ownerDocument.selection.createRange()
    } catch (n) {}
    return e && e.parentElement() == t ? 0 != e.compareEndPoints("StartToEnd", e) : !1
  };
  t.defineMode("null", function() {
    return {
      token: function(t) {
        t.skipToEnd()
      }
    }
  }), t.defineMIME("text/plain", "null");
  var Z = {
    3: "Enter",
    8: "Backspace",
    9: "Tab",
    13: "Enter",
    16: "Shift",
    17: "Ctrl",
    18: "Alt",
    19: "Pause",
    20: "CapsLock",
    27: "Esc",
    32: "Space",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "Left",
    38: "Up",
    39: "Right",
    40: "Down",
    44: "PrintScrn",
    45: "Insert",
    46: "Delete",
    59: ";",
    91: "Mod",
    92: "Mod",
    93: "Mod",
    186: ";",
    187: "=",
    188: ",",
    189: "-",
    190: ".",
    191: "/",
    192: "`",
    219: "[",
    220: "\\",
    221: "]",
    222: "'",
    63276: "PageUp",
    63277: "PageDown",
    63275: "End",
    63273: "Home",
    63234: "Left",
    63232: "Up",
    63235: "Right",
    63233: "Down",
    63302: "Insert",
    63272: "Delete"
  };
  return t.keyNames = Z,
    function() {
      for (var t = 0; 10 > t; t++) Z[t + 48] = String(t);
      for (var t = 65; 90 >= t; t++) Z[t] = String.fromCharCode(t);
      for (var t = 1; 12 >= t; t++) Z[t + 111] = Z[t + 63235] = "F" + t
    }(), t
}();
CodeMirror.defineMode("xml", function(t, e) {
  function n(t, e) {
    function n(n) {
      return e.tokenize = n, n(t, e)
    }
    var i = t.next();
    if ("<" == i) {
      if (t.eat("!")) return t.eat("[") ? t.match("CDATA[") ? n(o("atom", "]]>")) : null : t.match("--") ? n(o("comment", "-->")) : t.match("DOCTYPE", !0, !0) ? (t.eatWhile(/[\w\._\-]/), n(l(1))) : null;
      if (t.eat("?")) return t.eatWhile(/[\w\._\-]/), e.tokenize = o("meta", "?>"), "meta";
      x = t.eat("/") ? "closeTag" : "openTag", t.eatSpace(), v = "";
      for (var a; a = t.eat(/[^\s\u00a0=<>\"\'\/?]/);) v += a;
      return e.tokenize = r, "tag"
    }
    return "&" == i ? (t.eatWhile(/[^;]/), t.eat(";"), "atom") : (t.eatWhile(/[^&<]/), null)
  }

  function r(t, e) {
    var r = t.next();
    return ">" == r || "/" == r && t.eat(">") ? (e.tokenize = n, x = ">" == r ? "endTag" : "selfcloseTag", "tag") : "=" == r ? (x = "equals", null) : /[\'\"]/.test(r) ? (e.tokenize = i(r), e.tokenize(t, e)) : (t.eatWhile(/[^\s\u00a0=<>\"\'\/?]/), "word")
  }

  function i(t) {
    return function(e, n) {
      for (; !e.eol();)
        if (e.next() == t) {
          n.tokenize = r;
          break
        } return "string"
    }
  }

  function o(t, e) {
    return function(r, i) {
      for (; !r.eol();) {
        if (r.match(e)) {
          i.tokenize = n;
          break
        }
        r.next()
      }
      return t
    }
  }

  function l(t) {
    return function(e, r) {
      for (var i; null != (i = e.next());) {
        if ("<" == i) return r.tokenize = l(t + 1), r.tokenize(e, r);
        if (">" == i) {
          if (1 == t) {
            r.tokenize = n;
            break
          }
          return r.tokenize = l(t - 1), r.tokenize(e, r)
        }
      }
      return "meta"
    }
  }

  function a() {
    for (var t = arguments.length - 1; t >= 0; t--) y.cc.push(arguments[t])
  }

  function s() {
    return a.apply(null, arguments), !0
  }

  function u(t, e) {
    var n = w.doNotIndent.hasOwnProperty(t) || y.context && y.context.noIndent;
    y.context = {
      prev: y.context,
      tagName: t,
      indent: y.indented,
      startOfLine: e,
      noIndent: n
    }
  }

  function f() {
    y.context && (y.context = y.context.prev)
  }

  function c(t) {
    if ("openTag" == t) return y.tagName = v, s(m, h(y.startOfLine));
    if ("closeTag" == t) {
      var e = !1;
      return e = y.context ? y.context.tagName != v : !0, e && (k = "error"), s(d(e))
    }
    return s()
  }

  function h(t) {
    return function(e) {
      return "selfcloseTag" == e || "endTag" == e && w.autoSelfClosers.hasOwnProperty(y.tagName.toLowerCase()) ? s() : "endTag" == e ? (u(y.tagName, t), s()) : s()
    }
  }

  function d(t) {
    return function(e) {
      return t && (k = "error"), "endTag" == e ? (f(), s()) : (k = "error", s(arguments.callee))
    }
  }

  function m(t) {
    return "word" == t ? (k = "attribute", s(m)) : "equals" == t ? s(p, m) : "string" == t ? (k = "error", s(m)) : a()
  }

  function p(t) {
    return "word" == t && w.allowUnquoted ? (k = "string", s()) : "string" == t ? s(g) : a()
  }

  function g(t) {
    return "string" == t ? s(g) : a()
  }
  var v, x, y, k, C = t.indentUnit,
    w = e.htmlMode ? {
      autoSelfClosers: {
        br: !0,
        img: !0,
        hr: !0,
        link: !0,
        input: !0,
        meta: !0,
        col: !0,
        frame: !0,
        base: !0,
        area: !0
      },
      doNotIndent: {
        pre: !0
      },
      allowUnquoted: !0
    } : {
      autoSelfClosers: {},
      doNotIndent: {},
      allowUnquoted: !1
    },
    M = e.alignCDATA;
  return {
    startState: function() {
      return {
        tokenize: n,
        cc: [],
        indented: 0,
        startOfLine: !0,
        tagName: null,
        context: null
      }
    },
    token: function(t, e) {
      if (t.sol() && (e.startOfLine = !0, e.indented = t.indentation()), t.eatSpace()) return null;
      k = x = v = null;
      var n = e.tokenize(t, e);
      if (e.type = x, (n || x) && "comment" != n)
        for (y = e;;) {
          var r = e.cc.pop() || c;
          if (r(x || n)) break
        }
      return e.startOfLine = !1, k || n
    },
    indent: function(t, e, i) {
      var o = t.context;
      if (t.tokenize != r && t.tokenize != n || o && o.noIndent) return i ? i.match(/^(\s*)/)[0].length : 0;
      if (M && /<!\[CDATA\[/.test(e)) return 0;
      for (o && /^<\//.test(e) && (o = o.prev); o && !o.startOfLine;) o = o.prev;
      return o ? o.indent + C : 0
    },
    compareStates: function(t, e) {
      if (t.indented != e.indented || t.tokenize != e.tokenize) return !1;
      for (var n = t.context, r = e.context;; n = n.prev, r = r.prev) {
        if (!n || !r) return n == r;
        if (n.tagName != r.tagName) return !1
      }
    },
    electricChars: "/"
  }
}), CodeMirror.defineMIME("application/xml", "xml"), CodeMirror.defineMIME("text/html", {
  name: "xml",
  htmlMode: !0
}), CodeMirror.defineMode("javascript", function(t, e) {
  function n(t, e, n) {
    return e.tokenize = n, n(t, e)
  }

  function r(t, e) {
    for (var n, r = !1; null != (n = t.next());) {
      if (n == e && !r) return !1;
      r = !r && "\\" == n
    }
    return r
  }

  function i(t, e, n) {
    return O = t, R = n, e
  }

  function o(t, e) {
    var o = t.next();
    if ('"' == o || "'" == o) return n(t, e, l(o));
    if (/[\[\]{}\(\),;\:\.]/.test(o)) return i(o);
    if ("0" == o && t.eat(/x/i)) return t.eatWhile(/[\da-f]/i), i("number", "number");
    if (/\d/.test(o)) return t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/), i("number", "number");
    if ("/" == o) return t.eat("*") ? n(t, e, a) : t.eat("/") ? (t.skipToEnd(), i("comment", "comment")) : e.reAllowed ? (r(t, "/"), t.eatWhile(/[gimy]/), i("regexp", "string")) : (t.eatWhile(V), i("operator", null, t.current()));
    if ("#" == o) return t.skipToEnd(), i("error", "error");
    if (V.test(o)) return t.eatWhile(V), i("operator", null, t.current());
    t.eatWhile(/[\w\$_]/);
    var s = t.current(),
      u = B.propertyIsEnumerable(s) && B[s];
    return u && e.kwAllowed ? i(u.type, u.style, s) : i("variable", "variable", s)
  }

  function l(t) {
    return function(e, n) {
      return r(e, t) || (n.tokenize = o), i("string", "string")
    }
  }

  function a(t, e) {
    for (var n, r = !1; n = t.next();) {
      if ("/" == n && r) {
        e.tokenize = o;
        break
      }
      r = "*" == n
    }
    return i("comment", "comment")
  }

  function s(t, e, n, r, i, o) {
    this.indented = t, this.column = e, this.type = n, this.prev = i, this.info = o, null != r && (this.align = r)
  }

  function u(t, e) {
    for (var n = t.localVars; n; n = n.next)
      if (n.name == e) return !0
  }

  function f(t, e, n, r, i) {
    var o = t.cc;
    for (F.state = t, F.stream = i, F.marked = null, F.cc = o, t.lexical.hasOwnProperty("align") || (t.lexical.align = !0);;) {
      var l = o.length ? o.pop() : U ? k : y;
      if (l(n, r)) {
        for (; o.length && o[o.length - 1].lex;) o.pop()();
        return F.marked ? F.marked : "variable" == n && u(t, r) ? "variable-2" : e
      }
    }
  }

  function c() {
    for (var t = arguments.length - 1; t >= 0; t--) F.cc.push(arguments[t])
  }

  function h() {
    return c.apply(null, arguments), !0
  }

  function d(t) {
    var e = F.state;
    if (e.context) {
      F.marked = "def";
      for (var n = e.localVars; n; n = n.next)
        if (n.name == t) return;
      e.localVars = {
        name: t,
        next: e.localVars
      }
    }
  }

  function m() {
    F.state.context || (F.state.localVars = j), F.state.context = {
      prev: F.state.context,
      vars: F.state.localVars
    }
  }

  function p() {
    F.state.localVars = F.state.context.vars, F.state.context = F.state.context.prev
  }

  function g(t, e) {
    var n = function() {
      var n = F.state;
      n.lexical = new s(n.indented, F.stream.column(), t, null, n.lexical, e)
    };
    return n.lex = !0, n
  }

  function v() {
    var t = F.state;
    t.lexical.prev && (")" == t.lexical.type && (t.indented = t.lexical.indented), t.lexical = t.lexical.prev)
  }

  function x(t) {
    return function(e) {
      return e == t ? h() : ";" == t ? c() : h(arguments.callee)
    }
  }

  function y(t) {
    return "var" == t ? h(g("vardef"), z, x(";"), v) : "keyword a" == t ? h(g("form"), k, y, v) : "keyword b" == t ? h(g("form"), y, v) : "{" == t ? h(g("}"), A, v) : ";" == t ? h() : "function" == t ? h(H) : "for" == t ? h(g("form"), x("("), g(")"), E, x(")"), v, y, v) : "variable" == t ? h(g("stat"), M) : "switch" == t ? h(g("form"), k, g("}", "switch"), x("{"), A, v, v) : "case" == t ? h(k, x(":")) : "default" == t ? h(x(":")) : "catch" == t ? h(g("form"), m, x("("), I, x(")"), y, v, p) : c(g("stat"), k, x(";"), v)
  }

  function k(t) {
    return K.hasOwnProperty(t) ? h(w) : "function" == t ? h(H) : "keyword c" == t ? h(C) : "(" == t ? h(g(")"), k, x(")"), v, w) : "operator" == t ? h(k) : "[" == t ? h(g("]"), L(k, "]"), v, w) : "{" == t ? h(g("}"), L(S, "}"), v, w) : h()
  }

  function C(t) {
    return t.match(/[;\}\)\],]/) ? c() : c(k)
  }

  function w(t, e) {
    if ("operator" == t && /\+\+|--/.test(e)) return h(w);
    if ("operator" == t) return h(k);
    if (";" != t) return "(" == t ? h(g(")"), L(k, ")"), v, w) : "." == t ? h(b, w) : "[" == t ? h(g("]"), k, x("]"), v, w) : void 0
  }

  function M(t) {
    return ":" == t ? h(v, y) : c(w, x(";"), v)
  }

  function b(t) {
    return "variable" == t ? (F.marked = "property", h()) : void 0
  }

  function S(t) {
    return "variable" == t && (F.marked = "property"), K.hasOwnProperty(t) ? h(x(":"), k) : void 0
  }

  function L(t, e) {
    function n(r) {
      return "," == r ? h(t, n) : r == e ? h() : h(x(e))
    }
    return function(r) {
      return r == e ? h() : c(t, n)
    }
  }

  function A(t) {
    return "}" == t ? h() : c(y, A)
  }

  function z(t, e) {
    return "variable" == t ? (d(e), h(T)) : h()
  }

  function T(t, e) {
    return "=" == e ? h(k, T) : "," == t ? h(z) : void 0
  }

  function E(t) {
    return "var" == t ? h(z, N) : ";" == t ? c(N) : "variable" == t ? h(W) : c(N)
  }

  function W(t, e) {
    return "in" == e ? h(k) : h(w, N)
  }

  function N(t, e) {
    return ";" == t ? h(D) : "in" == e ? h(k) : h(k, x(";"), D)
  }

  function D(t) {
    ")" != t && h(k)
  }

  function H(t, e) {
    return "variable" == t ? (d(e), h(H)) : "(" == t ? h(g(")"), m, L(I, ")"), v, y, p) : void 0
  }

  function I(t, e) {
    return "variable" == t ? (d(e), h()) : void 0
  }
  var O, R, P = t.indentUnit,
    U = e.json,
    B = function() {
      function t(t) {
        return {
          type: t,
          style: "keyword"
        }
      }
      var e = t("keyword a"),
        n = t("keyword b"),
        r = t("keyword c"),
        i = t("operator"),
        o = {
          type: "atom",
          style: "atom"
        };
      return {
        "if": e,
        "while": e,
        "with": e,
        "else": n,
        "do": n,
        "try": n,
        "finally": n,
        "return": r,
        "break": r,
        "continue": r,
        "new": r,
        "delete": r,
        "throw": r,
        "var": t("var"),
        "const": t("var"),
        let: t("var"),
        "function": t("function"),
        "catch": t("catch"),
        "for": t("for"),
        "switch": t("switch"),
        "case": t("case"),
        "default": t("default"),
        "in": i,
        "typeof": i,
        "instanceof": i,
        "true": o,
        "false": o,
        "null": o,
        undefined: o,
        NaN: o,
        Infinity: o
      }
    }(),
    V = /[+\-*&%=<>!?|]/,
    K = {
      atom: !0,
      number: !0,
      variable: !0,
      string: !0,
      regexp: !0
    },
    F = {
      state: null,
      column: null,
      marked: null,
      cc: null
    },
    j = {
      name: "this",
      next: {
        name: "arguments"
      }
    };
  return v.lex = !0, {
    startState: function(t) {
      return {
        tokenize: o,
        reAllowed: !0,
        kwAllowed: !0,
        cc: [],
        lexical: new s((t || 0) - P, 0, "block", !1),
        localVars: null,
        context: null,
        indented: 0
      }
    },
    token: function(t, e) {
      if (t.sol() && (e.lexical.hasOwnProperty("align") || (e.lexical.align = !1), e.indented = t.indentation()), t.eatSpace()) return null;
      var n = e.tokenize(t, e);
      return "comment" == O ? n : (e.reAllowed = "operator" == O || "keyword c" == O || O.match(/^[\[{}\(,;:]$/), e.kwAllowed = "." != O, f(e, n, O, R, t))
    },
    indent: function(t, e) {
      if (t.tokenize != o) return 0;
      var n = e && e.charAt(0),
        r = t.lexical,
        i = r.type,
        l = n == i;
      return "vardef" == i ? r.indented + 4 : "form" == i && "{" == n ? r.indented : "stat" == i || "form" == i ? r.indented + P : "switch" != r.info || l ? r.align ? r.column + (l ? 0 : 1) : r.indented + (l ? 0 : P) : r.indented + (/^(?:case|default)\b/.test(e) ? P : 2 * P)
    },
    electricChars: ":{}"
  }
}), CodeMirror.defineMIME("text/javascript", "javascript"), CodeMirror.defineMIME("application/json", {
  name: "javascript",
  json: !0
}), CodeMirror.defineMode("css", function(t) {
  function e(t, e) {
    return l = e, t
  }

  function n(t, n) {
    var l = t.next();
    return "@" == l ? (t.eatWhile(/[\w\\\-]/), e("meta", t.current())) : "/" == l && t.eat("*") ? (n.tokenize = r, r(t, n)) : "<" == l && t.eat("!") ? (n.tokenize = i, i(t, n)) : "=" != l ? "~" != l && "|" != l || !t.eat("=") ? '"' == l || "'" == l ? (n.tokenize = o(l), n.tokenize(t, n)) : "#" == l ? (t.eatWhile(/[\w\\\-]/), e("atom", "hash")) : "!" == l ? (t.match(/^\s*\w*/), e("keyword", "important")) : /\d/.test(l) ? (t.eatWhile(/[\w.%]/), e("number", "unit")) : /[,.+>*\/]/.test(l) ? e(null, "select-op") : /[;{}:\[\]]/.test(l) ? e(null, l) : (t.eatWhile(/[\w\\\-]/), e("variable", "variable")) : e(null, "compare") : void e(null, "compare")
  }

  function r(t, r) {
    for (var i, o = !1; null != (i = t.next());) {
      if (o && "/" == i) {
        r.tokenize = n;
        break
      }
      o = "*" == i
    }
    return e("comment", "comment")
  }

  function i(t, r) {
    for (var i, o = 0; null != (i = t.next());) {
      if (o >= 2 && ">" == i) {
        r.tokenize = n;
        break
      }
      o = "-" == i ? o + 1 : 0
    }
    return e("comment", "comment")
  }

  function o(t) {
    return function(r, i) {
      for (var o, l = !1; null != (o = r.next()) && (o != t || l);) l = !l && "\\" == o;
      return l || (i.tokenize = n), e("string", "string")
    }
  }
  var l, a = t.indentUnit;
  return {
    startState: function(t) {
      return {
        tokenize: n,
        baseIndent: t || 0,
        stack: []
      }
    },
    token: function(t, e) {
      if (t.eatSpace()) return null;
      var n = e.tokenize(t, e),
        r = e.stack[e.stack.length - 1];
      return "hash" == l && "rule" == r ? n = "atom" : "variable" == n && ("rule" == r ? n = "number" : r && "@media{" != r || (n = "tag")), "rule" == r && /^[\{\};]$/.test(l) && e.stack.pop(), "{" == l ? "@media" == r ? e.stack[e.stack.length - 1] = "@media{" : e.stack.push("{") : "}" == l ? e.stack.pop() : "@media" == l ? e.stack.push("@media") : "{" == r && "comment" != l && e.stack.push("rule"), n
    },
    indent: function(t, e) {
      var n = t.stack.length;
      return /^\}/.test(e) && (n -= "rule" == t.stack[t.stack.length - 1] ? 2 : 1), t.baseIndent + n * a
    },
    electricChars: "}"
  }
}), CodeMirror.defineMIME("text/css", "css"), CodeMirror.defineMode("htmlmixed", function(t) {
  function e(t, e) {
    var n = o.token(t, e.htmlState);
    return "tag" == n && ">" == t.current() && e.htmlState.context && (/^script$/i.test(e.htmlState.context.tagName) ? (e.token = r, e.localState = l.startState(o.indent(e.htmlState, "")), e.mode = "javascript") : /^style$/i.test(e.htmlState.context.tagName) && (e.token = i, e.localState = a.startState(o.indent(e.htmlState, "")), e.mode = "css")), n
  }

  function n(t, e, n) {
    var r = t.current(),
      i = r.search(e);
    return i > -1 && t.backUp(r.length - i), n
  }

  function r(t, r) {
    return t.match(/^<\/\s*script\s*>/i, !1) ? (r.token = e, r.curState = null, r.mode = "html", e(t, r)) : n(t, /<\/\s*script\s*>/, l.token(t, r.localState))
  }

  function i(t, r) {
    return t.match(/^<\/\s*style\s*>/i, !1) ? (r.token = e, r.localState = null, r.mode = "html", e(t, r)) : n(t, /<\/\s*style\s*>/, a.token(t, r.localState))
  }
  var o = CodeMirror.getMode(t, {
      name: "xml",
      htmlMode: !0
    }),
    l = CodeMirror.getMode(t, "javascript"),
    a = CodeMirror.getMode(t, "css");
  return {
    startState: function() {
      var t = o.startState();
      return {
        token: e,
        localState: null,
        mode: "html",
        htmlState: t
      }
    },
    copyState: function(t) {
      if (t.localState) var e = CodeMirror.copyState(t.token == i ? a : l, t.localState);
      return {
        token: t.token,
        localState: e,
        mode: t.mode,
        htmlState: CodeMirror.copyState(o, t.htmlState)
      }
    },
    token: function(t, e) {
      return e.token(t, e)
    },
    indent: function(t, n) {
      return t.token == e || /^\s*<\//.test(n) ? o.indent(t.htmlState, n) : t.token == r ? l.indent(t.localState, n) : a.indent(t.localState, n)
    },
    compareStates: function(t, e) {
      return o.compareStates(t.htmlState, e.htmlState)
    },
    electricChars: "/{}:"
  }
}), CodeMirror.defineMIME("text/html", "htmlmixed");
